/* Generated by Cython 3.2.4 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#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_2_4"
#define CYTHON_HEX_VERSION 0x030204F0
#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 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 0
  #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
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 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
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 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_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
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 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
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#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)
#endif
#endif
#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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  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)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#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 < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (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 Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#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))
#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 PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #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 && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_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
#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 && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif 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
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !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) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(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 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>
#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__pyarrow___flight
#define __PYX_HAVE_API__pyarrow___flight
/* Early includes */
#include <string.h>
#include <stdio.h>

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE PyObject *
    __Pyx_CAPI_PyList_GetItemRef(PyObject *list, Py_ssize_t index)
    {
        PyObject *item = PyList_GetItem(list, index);
        Py_XINCREF(item);
        return item;
    }
    #else
    #define __Pyx_CAPI_PyList_GetItemRef PyList_GetItemRef
    #endif

    #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Extend(PyObject *list, PyObject *iterable)
    {
        return PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable);
    }

    static CYTHON_INLINE int
    __Pyx_CAPI_PyList_Clear(PyObject *list)
    {
        return PyList_SetSlice(list, 0, PY_SSIZE_T_MAX, NULL);
    }
    #else
    #define __Pyx_CAPI_PyList_Extend PyList_Extend
    #define __Pyx_CAPI_PyList_Clear PyList_Clear
    #endif
    

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    
#include <stddef.h>

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

    #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result)
    {
        int res;
        PyObject *key_obj = PyUnicode_FromString(key);
        if (key_obj == NULL) {
            *result = NULL;
            return -1;
        }
        res = __Pyx_PyDict_GetItemRef(mp, key_obj, result);
        Py_DECREF(key_obj);
        return res;
    }
    #else
    #define __Pyx_CAPI_PyDict_GetItemStringRef PyDict_GetItemStringRef
    #endif
    #if PY_VERSION_HEX < 0x030d0000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030F0000)
    static CYTHON_INLINE int
    __Pyx_CAPI_PyDict_SetDefaultRef(PyObject *d, PyObject *key, PyObject *default_value,
                        PyObject **result)
    {
        PyObject *value;
        if (__Pyx_PyDict_GetItemRef(d, key, &value) < 0) {
            // get error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (value != NULL) {
            // present
            if (result) {
                *result = value;
            }
            else {
                Py_DECREF(value);
            }
            return 1;
        }

        // missing: set the item
        if (PyDict_SetItem(d, key, default_value) < 0) {
            // set error
            if (result) {
                *result = NULL;
            }
            return -1;
        }
        if (result) {
            Py_INCREF(default_value);
            *result = default_value;
        }
        return 0;
    }
    #else
    #define __Pyx_CAPI_PyDict_SetDefaultRef PyDict_SetDefaultRef
    #endif
    

    #if PY_VERSION_HEX < 0x030d0000
    static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
    {
        PyObject *obj = PyWeakref_GetObject(ref);
        if (obj == NULL) {
            // SystemError if ref is NULL
            *pobj = NULL;
            return -1;
        }
        if (obj == Py_None) {
            *pobj = NULL;
            return 0;
        }
        Py_INCREF(obj);
        *pobj = obj;
        return 1;
    }
    #else
    #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef
    #endif
    
#include "pythread.h"

    #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <memory>
#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 <stdint.h>
#include <functional>
#include <optional>
#include <string_view>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>

    #if CYTHON_COMPILING_IN_LIMITED_API
    #ifdef _MSC_VER
    #pragma message ("This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.")
    #else
    #warning This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.
    #endif
    #endif
    
#include "datetime.h"

    #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)         PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second,             microsecond, tz, fold, PyDateTimeAPI->DateTimeType)
    #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)         PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType)

    #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC
    #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name)

    /* Backport for Python < 3.10 */
    #if PY_VERSION_HEX < 0x030a00a1
        #ifndef PyDateTime_TIME_GET_TZINFO
            #define PyDateTime_TIME_GET_TZINFO(o)                 ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None)
        #endif
        #ifndef PyDateTime_DATE_GET_TZINFO
            #define PyDateTime_DATE_GET_TZINFO(o)                 ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None)
        #endif
    #endif
    

    #include <memory>
    #include <string>
    #include <string_view>
    #include <utility>

    namespace arrow {
    namespace py {

    template <typename T>
    std::shared_ptr<T> to_shared(std::unique_ptr<T>& t) {
        return std::move(t);
    }
    template <typename T>
    std::shared_ptr<T> to_shared(std::unique_ptr<T>&& t) {
        return std::move(t);
    }

    // Needed until https://github.com/cython/cython/issues/6651 is fixed
    inline std::string to_string(std::string_view s) {
        return std::string(s);
    }

    }  // namespace py
    }  // namespace arrow
    
#include "arrow/python/platform.h"
#include <Python.h>
#include "arrow/api.h"
#include "arrow/result.h"
#include "arrow/util/future.h"
#include "arrow/python/async.h"
#include "arrow/python/common.h"
#include "arrow/util/key_value_metadata.h"
#include "arrow/util/decimal.h"
#include "arrow/config.h"
#include <variant>
#include "arrow/c/dlpack_abi.h"
#include "arrow/c/dlpack.h"
#include "arrow/builder.h"
#include "arrow/util/cancel.h"
#include "arrow/io/api.h"
#include "arrow/ipc/api.h"
#include "arrow/util/value_parsing.h"
#include "arrow/csv/api.h"
#include "arrow/json/options.h"
#include "arrow/json/reader.h"
#include "arrow/util/thread_pool.h"
#include "arrow/compute/api.h"

    #include "arrow/compute/function.h"
    namespace arrow {
    namespace compute {
    namespace internal {
    Result<std::unique_ptr<FunctionOptions>> DeserializeFunctionOptions(
        const Buffer& buffer);
    } //  namespace internal
    } //  namespace compute
    } //  namespace arrow
    

    #include <unordered_map>

    #include "arrow/type.h"
    #include "arrow/datum.h"

    namespace arrow {
    namespace compute {
    struct KnownFieldValues {
      std::unordered_map<FieldRef, Datum, FieldRef::Hash> map;
    };
    } //  namespace compute
    } //  namespace arrow
    
#include "arrow/compute/expression.h"
#include "arrow/extension_type.h"
#include "arrow/extension/json.h"
#include "arrow/extension/uuid.h"
#include "arrow/extension/fixed_shape_tensor.h"
#include "arrow/extension/opaque.h"
#include "arrow/extension/bool8.h"
#include "arrow/util/compression.h"
#include "arrow/util/io_util.h"
#include "arrow/util/iterator.h"
#include "arrow/util/secure_string.h"
#include "arrow/array/concatenate.h"
#include "arrow/c/abi.h"
#include "arrow/c/bridge.h"
#include "arrow/util/byte_size.h"
#include "arrow/python/udf.h"
#include "arrow/compute/cast.h"
#include "arrow/python/csv.h"
#include "arrow/python/api.h"
#include "arrow/python/arrow_to_pandas.h"
#include "arrow/python/numpy_init.h"
#include "arrow/python/pyarrow.h"
#include "arrow/python/inference.h"
#include "arrow/python/ipc.h"
#include "arrow/python/extension_type.h"
#include "arrow/python/benchmark.h"
#include "arrow/python/gdb.h"
#include "arrow/python/helpers.h"
#include "arrow/python/config.h"
#include <map>
#include "arrow/flight/api.h"
#include "arrow/python/flight.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
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
#if __cplusplus > 201103L
#include <type_traits>
#endif
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[] = {
  "pyarrow/_flight.pyx",
  "string.to_py",
  "cpython/contextvars.pxd",
  "cpython/datetime.pxd",
  "cpython/type.pxd",
  "cpython/bool.pxd",
  "cpython/complex.pxd",
  "pyarrow/lib.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

/* Atomics.proto (used by UnpackUnboundCMethod) */
#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)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #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)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #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_nonatomic_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)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #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
    #define __pyx_nonatomic_ptr_type void*
    #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)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #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

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#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

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

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

/*--- Type declarations ---*/
struct __pyx_obj_7pyarrow_3lib__Weakrefable;
struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions;
struct __pyx_obj_7pyarrow_3lib_IpcReadOptions;
struct __pyx_obj_7pyarrow_3lib_Message;
struct __pyx_obj_7pyarrow_3lib_MemoryPool;
struct __pyx_obj_7pyarrow_3lib_DataType;
struct __pyx_obj_7pyarrow_3lib_ListType;
struct __pyx_obj_7pyarrow_3lib_LargeListType;
struct __pyx_obj_7pyarrow_3lib_ListViewType;
struct __pyx_obj_7pyarrow_3lib_LargeListViewType;
struct __pyx_obj_7pyarrow_3lib_MapType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListType;
struct __pyx_obj_7pyarrow_3lib_StructType;
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo;
struct __pyx_obj_7pyarrow_3lib_DictionaryType;
struct __pyx_obj_7pyarrow_3lib_TimestampType;
struct __pyx_obj_7pyarrow_3lib_Time32Type;
struct __pyx_obj_7pyarrow_3lib_Time64Type;
struct __pyx_obj_7pyarrow_3lib_DurationType;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType;
struct __pyx_obj_7pyarrow_3lib_Decimal32Type;
struct __pyx_obj_7pyarrow_3lib_Decimal64Type;
struct __pyx_obj_7pyarrow_3lib_Decimal128Type;
struct __pyx_obj_7pyarrow_3lib_Decimal256Type;
struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType;
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType;
struct __pyx_obj_7pyarrow_3lib_ExtensionType;
struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType;
struct __pyx_obj_7pyarrow_3lib_Bool8Type;
struct __pyx_obj_7pyarrow_3lib_OpaqueType;
struct __pyx_obj_7pyarrow_3lib_UuidType;
struct __pyx_obj_7pyarrow_3lib_JsonType;
struct __pyx_obj_7pyarrow_3lib__Metadata;
struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata;
struct __pyx_obj_7pyarrow_3lib_Field;
struct __pyx_obj_7pyarrow_3lib_Schema;
struct __pyx_obj_7pyarrow_3lib_Scalar;
struct __pyx_obj_7pyarrow_3lib_ArrayStatistics;
struct __pyx_obj_7pyarrow_3lib__PandasConvertible;
struct __pyx_obj_7pyarrow_3lib_Array;
struct __pyx_obj_7pyarrow_3lib_Tensor;
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix;
struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix;
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor;
struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor;
struct __pyx_obj_7pyarrow_3lib_NullArray;
struct __pyx_obj_7pyarrow_3lib_BooleanArray;
struct __pyx_obj_7pyarrow_3lib_NumericArray;
struct __pyx_obj_7pyarrow_3lib_IntegerArray;
struct __pyx_obj_7pyarrow_3lib_FloatingPointArray;
struct __pyx_obj_7pyarrow_3lib_Int8Array;
struct __pyx_obj_7pyarrow_3lib_UInt8Array;
struct __pyx_obj_7pyarrow_3lib_Int16Array;
struct __pyx_obj_7pyarrow_3lib_UInt16Array;
struct __pyx_obj_7pyarrow_3lib_Int32Array;
struct __pyx_obj_7pyarrow_3lib_UInt32Array;
struct __pyx_obj_7pyarrow_3lib_Int64Array;
struct __pyx_obj_7pyarrow_3lib_UInt64Array;
struct __pyx_obj_7pyarrow_3lib_HalfFloatArray;
struct __pyx_obj_7pyarrow_3lib_FloatArray;
struct __pyx_obj_7pyarrow_3lib_DoubleArray;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray;
struct __pyx_obj_7pyarrow_3lib_Decimal32Array;
struct __pyx_obj_7pyarrow_3lib_Decimal64Array;
struct __pyx_obj_7pyarrow_3lib_Decimal128Array;
struct __pyx_obj_7pyarrow_3lib_Decimal256Array;
struct __pyx_obj_7pyarrow_3lib_StructArray;
struct __pyx_obj_7pyarrow_3lib_BaseListArray;
struct __pyx_obj_7pyarrow_3lib_ListArray;
struct __pyx_obj_7pyarrow_3lib_LargeListArray;
struct __pyx_obj_7pyarrow_3lib_ListViewArray;
struct __pyx_obj_7pyarrow_3lib_LargeListViewArray;
struct __pyx_obj_7pyarrow_3lib_MapArray;
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray;
struct __pyx_obj_7pyarrow_3lib_UnionArray;
struct __pyx_obj_7pyarrow_3lib_StringArray;
struct __pyx_obj_7pyarrow_3lib_BinaryArray;
struct __pyx_obj_7pyarrow_3lib_StringViewArray;
struct __pyx_obj_7pyarrow_3lib_BinaryViewArray;
struct __pyx_obj_7pyarrow_3lib_DictionaryArray;
struct __pyx_obj_7pyarrow_3lib_ExtensionArray;
struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray;
struct __pyx_obj_7pyarrow_3lib_ChunkedArray;
struct __pyx_obj_7pyarrow_3lib__Tabular;
struct __pyx_obj_7pyarrow_3lib_Table;
struct __pyx_obj_7pyarrow_3lib_RecordBatch;
struct __pyx_obj_7pyarrow_3lib_Device;
struct __pyx_obj_7pyarrow_3lib_MemoryManager;
struct __pyx_obj_7pyarrow_3lib_Buffer;
struct __pyx_obj_7pyarrow_3lib_ResizableBuffer;
struct __pyx_obj_7pyarrow_3lib_NativeFile;
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream;
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream;
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream;
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter;
struct __pyx_obj_7pyarrow_3lib_RecordBatchReader;
struct __pyx_obj_7pyarrow_3lib_CacheOptions;
struct __pyx_obj_7pyarrow_3lib_Codec;
struct __pyx_obj_7pyarrow_3lib_StopToken;
struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions;
struct __pyx_obj_7pyarrow_7_flight_FlightError;
struct __pyx_obj_7pyarrow_7_flight_FlightInternalError;
struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError;
struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError;
struct __pyx_obj_7pyarrow_7_flight_FlightServerError;
struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError;
struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError;
struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError;
struct __pyx_obj_7pyarrow_7_flight_Action;
struct __pyx_obj_7pyarrow_7_flight_Result;
struct __pyx_obj_7pyarrow_7_flight_BasicAuth;
struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor;
struct __pyx_obj_7pyarrow_7_flight_Ticket;
struct __pyx_obj_7pyarrow_7_flight_Location;
struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint;
struct __pyx_obj_7pyarrow_7_flight_SchemaResult;
struct __pyx_obj_7pyarrow_7_flight_FlightInfo;
struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk;
struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader;
struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader;
struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader;
struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter;
struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter;
struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader;
struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter;
struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient;
struct __pyx_obj_7pyarrow_7_flight_FlightClient;
struct __pyx_obj_7pyarrow_7_flight_FlightDataStream;
struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream;
struct __pyx_obj_7pyarrow_7_flight_GeneratorStream;
struct __pyx_obj_7pyarrow_7_flight_ServerCallContext;
struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader;
struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender;
struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader;
struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender;
struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler;
struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler;
struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory;
struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware;
struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory;
struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory;
struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware;
struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper;
struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper;
struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer;
struct __pyx_obj_7pyarrow_7_flight_FlightServerBase;
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info;
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action;
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response;
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

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

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

/* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_time_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/
struct __pyx_opt_args_7cpython_8datetime_timezone_new {
  int __pyx_n;
  PyObject *name;
};

/* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
  int __pyx_n;
  PyObject *tz;
};

/* "pyarrow/includes/libarrow.pxd":1560
 * 
 * # Use typedef to emulate syntax for std::function<void(..)>
 * ctypedef void CallbackTransform(object, const shared_ptr[CBuffer]& src,             # <<<<<<<<<<<<<<
 *                                 shared_ptr[CBuffer]* dest)
 * 
*/
typedef void __pyx_t_7pyarrow_8includes_8libarrow_CallbackTransform(PyObject *, std::shared_ptr< arrow::Buffer>  const &, std::shared_ptr< arrow::Buffer>  *);

/* "pyarrow/includes/libarrow.pxd":1563
 *                                 shared_ptr[CBuffer]* dest)
 * 
 * ctypedef CResult[shared_ptr[CInputStream]] StreamWrapFunc(             # <<<<<<<<<<<<<<
 *     shared_ptr[CInputStream])
 * 
*/
typedef arrow::Result<std::shared_ptr< arrow::io::InputStream> >  __pyx_t_7pyarrow_8includes_8libarrow_StreamWrapFunc(std::shared_ptr< arrow::io::InputStream> );

/* "pyarrow/includes/libarrow.pxd":3239
 *     int64_t TotalBufferSize(const CTable& table)
 * 
 * ctypedef PyObject* CallbackUdf(object user_function, const CUdfContext& context, object inputs)             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef PyObject *__pyx_t_7pyarrow_8includes_8libarrow_CallbackUdf(PyObject *,  arrow::py::UdfContext const &, PyObject *);

/* "pyarrow/includes/libarrow_python.pxd":24
 * 
 * 
 * ctypedef CInvalidRowResult PyInvalidRowCallback(object,             # <<<<<<<<<<<<<<
 *                                                 const CCSVInvalidRow&)
 * 
*/
typedef  arrow::csv::InvalidRowResult __pyx_t_7pyarrow_8includes_15libarrow_python_PyInvalidRowCallback(PyObject *,  arrow::csv::InvalidRow const &);
struct __pyx_opt_args_7pyarrow_3lib_ensure_type;

/* "pyarrow/lib.pxd":676
 * 
 * # Default is allow_none=False
 * cpdef DataType ensure_type(object type, bint allow_none=*)             # <<<<<<<<<<<<<<
 * 
 * cdef DataType primitive_type(Type type)
*/
struct __pyx_opt_args_7pyarrow_3lib_ensure_type {
  int __pyx_n;
  int allow_none;
};

/* "pyarrow/includes/libarrow_flight.pxd":460
 * # Callbacks for implementing Flight servers
 * # Use typedef to emulate syntax for std::function<void(..)>
 * ctypedef CStatus cb_list_flights(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                                  const CCriteria*,
 *                                  unique_ptr[CFlightListing]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_list_flights(PyObject *,  arrow::flight::ServerCallContext const &,  arrow::flight::Criteria const *, std::unique_ptr< arrow::flight::FlightListing>  *);

/* "pyarrow/includes/libarrow_flight.pxd":463
 *                                  const CCriteria*,
 *                                  unique_ptr[CFlightListing]*)
 * ctypedef CStatus cb_get_flight_info(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                                     const CFlightDescriptor&,
 *                                     unique_ptr[CFlightInfo]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_flight_info(PyObject *,  arrow::flight::ServerCallContext const &,  arrow::flight::FlightDescriptor const &, std::unique_ptr< arrow::flight::FlightInfo>  *);

/* "pyarrow/includes/libarrow_flight.pxd":466
 *                                     const CFlightDescriptor&,
 *                                     unique_ptr[CFlightInfo]*)
 * ctypedef CStatus cb_get_schema(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                                const CFlightDescriptor&,
 *                                unique_ptr[CSchemaResult]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_schema(PyObject *,  arrow::flight::ServerCallContext const &,  arrow::flight::FlightDescriptor const &, std::unique_ptr< arrow::flight::SchemaResult>  *);

/* "pyarrow/includes/libarrow_flight.pxd":469
 *                                const CFlightDescriptor&,
 *                                unique_ptr[CSchemaResult]*)
 * ctypedef CStatus cb_do_put(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                            unique_ptr[CFlightMessageReader],
 *                            unique_ptr[CFlightMetadataWriter])
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_put(PyObject *,  arrow::flight::ServerCallContext const &, std::unique_ptr< arrow::flight::FlightMessageReader> , std::unique_ptr< arrow::flight::FlightMetadataWriter> );

/* "pyarrow/includes/libarrow_flight.pxd":472
 *                            unique_ptr[CFlightMessageReader],
 *                            unique_ptr[CFlightMetadataWriter])
 * ctypedef CStatus cb_do_get(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                            const CTicket&,
 *                            unique_ptr[CFlightDataStream]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_get(PyObject *,  arrow::flight::ServerCallContext const &,  arrow::flight::Ticket const &, std::unique_ptr< arrow::flight::FlightDataStream>  *);

/* "pyarrow/includes/libarrow_flight.pxd":475
 *                            const CTicket&,
 *                            unique_ptr[CFlightDataStream]*)
 * ctypedef CStatus cb_do_exchange(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                                 unique_ptr[CFlightMessageReader],
 *                                 unique_ptr[CFlightMessageWriter])
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_exchange(PyObject *,  arrow::flight::ServerCallContext const &, std::unique_ptr< arrow::flight::FlightMessageReader> , std::unique_ptr< arrow::flight::FlightMessageWriter> );

/* "pyarrow/includes/libarrow_flight.pxd":478
 *                                 unique_ptr[CFlightMessageReader],
 *                                 unique_ptr[CFlightMessageWriter])
 * ctypedef CStatus cb_do_action(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                               const CAction&,
 *                               unique_ptr[CResultStream]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_action(PyObject *,  arrow::flight::ServerCallContext const &,  arrow::flight::Action const &, std::unique_ptr< arrow::flight::ResultStream>  *);

/* "pyarrow/includes/libarrow_flight.pxd":481
 *                               const CAction&,
 *                               unique_ptr[CResultStream]*)
 * ctypedef CStatus cb_list_actions(object, const CServerCallContext&,             # <<<<<<<<<<<<<<
 *                                  vector[CActionType]*)
 * ctypedef CStatus cb_result_next(object, unique_ptr[CFlightResult]*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_list_actions(PyObject *,  arrow::flight::ServerCallContext const &, std::vector< arrow::flight::ActionType>  *);

/* "pyarrow/includes/libarrow_flight.pxd":483
 * ctypedef CStatus cb_list_actions(object, const CServerCallContext&,
 *                                  vector[CActionType]*)
 * ctypedef CStatus cb_result_next(object, unique_ptr[CFlightResult]*)             # <<<<<<<<<<<<<<
 * ctypedef CStatus cb_data_stream_next(object, CFlightPayload*)
 * ctypedef CStatus cb_server_authenticate(object, CServerAuthSender*,
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_result_next(PyObject *, std::unique_ptr< arrow::flight::Result>  *);

/* "pyarrow/includes/libarrow_flight.pxd":484
 *                                  vector[CActionType]*)
 * ctypedef CStatus cb_result_next(object, unique_ptr[CFlightResult]*)
 * ctypedef CStatus cb_data_stream_next(object, CFlightPayload*)             # <<<<<<<<<<<<<<
 * ctypedef CStatus cb_server_authenticate(object, CServerAuthSender*,
 *                                         CServerAuthReader*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_data_stream_next(PyObject *,  arrow::flight::FlightPayload *);

/* "pyarrow/includes/libarrow_flight.pxd":485
 * ctypedef CStatus cb_result_next(object, unique_ptr[CFlightResult]*)
 * ctypedef CStatus cb_data_stream_next(object, CFlightPayload*)
 * ctypedef CStatus cb_server_authenticate(object, CServerAuthSender*,             # <<<<<<<<<<<<<<
 *                                         CServerAuthReader*)
 * ctypedef CStatus cb_is_valid(object, const c_string&, c_string*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_server_authenticate(PyObject *,  arrow::flight::ServerAuthSender *,  arrow::flight::ServerAuthReader *);

/* "pyarrow/includes/libarrow_flight.pxd":487
 * ctypedef CStatus cb_server_authenticate(object, CServerAuthSender*,
 *                                         CServerAuthReader*)
 * ctypedef CStatus cb_is_valid(object, const c_string&, c_string*)             # <<<<<<<<<<<<<<
 * ctypedef CStatus cb_client_authenticate(object, CClientAuthSender*,
 *                                         CClientAuthReader*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_is_valid(PyObject *, std::string const &, std::string *);

/* "pyarrow/includes/libarrow_flight.pxd":488
 *                                         CServerAuthReader*)
 * ctypedef CStatus cb_is_valid(object, const c_string&, c_string*)
 * ctypedef CStatus cb_client_authenticate(object, CClientAuthSender*,             # <<<<<<<<<<<<<<
 *                                         CClientAuthReader*)
 * ctypedef CStatus cb_get_token(object, c_string*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_authenticate(PyObject *,  arrow::flight::ClientAuthSender *,  arrow::flight::ClientAuthReader *);

/* "pyarrow/includes/libarrow_flight.pxd":490
 * ctypedef CStatus cb_client_authenticate(object, CClientAuthSender*,
 *                                         CClientAuthReader*)
 * ctypedef CStatus cb_get_token(object, c_string*)             # <<<<<<<<<<<<<<
 * 
 * ctypedef CStatus cb_middleware_sending_headers(object, CAddCallHeaders*)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_token(PyObject *, std::string *);

/* "pyarrow/includes/libarrow_flight.pxd":492
 * ctypedef CStatus cb_get_token(object, c_string*)
 * 
 * ctypedef CStatus cb_middleware_sending_headers(object, CAddCallHeaders*)             # <<<<<<<<<<<<<<
 * ctypedef CStatus cb_middleware_call_completed(object, const CStatus&)
 * ctypedef CStatus cb_client_middleware_received_headers(
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_sending_headers(PyObject *,  arrow::flight::AddCallHeaders *);

/* "pyarrow/includes/libarrow_flight.pxd":493
 * 
 * ctypedef CStatus cb_middleware_sending_headers(object, CAddCallHeaders*)
 * ctypedef CStatus cb_middleware_call_completed(object, const CStatus&)             # <<<<<<<<<<<<<<
 * ctypedef CStatus cb_client_middleware_received_headers(
 *     object, const CCallHeaders&)
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_call_completed(PyObject *, arrow::Status const &);

/* "pyarrow/includes/libarrow_flight.pxd":494
 * ctypedef CStatus cb_middleware_sending_headers(object, CAddCallHeaders*)
 * ctypedef CStatus cb_middleware_call_completed(object, const CStatus&)
 * ctypedef CStatus cb_client_middleware_received_headers(             # <<<<<<<<<<<<<<
 *     object, const CCallHeaders&)
 * ctypedef CStatus cb_server_middleware_start_call(
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_middleware_received_headers(PyObject *,  arrow::flight::CallHeaders const &);

/* "pyarrow/includes/libarrow_flight.pxd":496
 * ctypedef CStatus cb_client_middleware_received_headers(
 *     object, const CCallHeaders&)
 * ctypedef CStatus cb_server_middleware_start_call(             # <<<<<<<<<<<<<<
 *     object,
 *     const CCallInfo&,
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_server_middleware_start_call(PyObject *,  arrow::flight::CallInfo const &,  arrow::flight::CallHeaders const &, std::shared_ptr< arrow::flight::ServerMiddleware>  *);

/* "pyarrow/includes/libarrow_flight.pxd":501
 *     const CCallHeaders&,
 *     shared_ptr[CServerMiddleware]*)
 * ctypedef CStatus cb_client_middleware_start_call(             # <<<<<<<<<<<<<<
 *     object,
 *     const CCallInfo&,
*/
typedef arrow::Status __pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_middleware_start_call(PyObject *,  arrow::flight::CallInfo const &, std::unique_ptr< arrow::flight::ClientMiddleware>  *);

/* "pyarrow/lib.pxd":37
 * 
 * 
 * cdef class _Weakrefable:             # <<<<<<<<<<<<<<
 *     cdef object __weakref__
 * 
*/
struct __pyx_obj_7pyarrow_3lib__Weakrefable {
  PyObject_HEAD
  PyObject *__weakref__;
};


/* "pyarrow/lib.pxd":41
 * 
 * 
 * cdef class IpcWriteOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcWriteOptions c_options
*/
struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::ipc::IpcWriteOptions c_options;
};


/* "pyarrow/lib.pxd":49
 * 
 * 
 * cdef class IpcReadOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CIpcReadOptions c_options
*/
struct __pyx_obj_7pyarrow_3lib_IpcReadOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::ipc::IpcReadOptions c_options;
};


/* "pyarrow/lib.pxd":60
 * 
 * 
 * cdef class Message(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unique_ptr[CMessage] message
*/
struct __pyx_obj_7pyarrow_3lib_Message {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::ipc::Message>  message;
};


/* "pyarrow/lib.pxd":65
 * 
 * 
 * cdef class MemoryPool(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
*/
struct __pyx_obj_7pyarrow_3lib_MemoryPool {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtab;
   arrow::MemoryPool *pool;
};


/* "pyarrow/lib.pxd":78
 * 
 * 
 * cdef class DataType(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
*/
struct __pyx_obj_7pyarrow_3lib_DataType {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtab;
  std::shared_ptr< arrow::DataType>  sp_type;
   arrow::DataType *type;
  PyObject *pep3118_format;
};


/* "pyarrow/lib.pxd":88
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListType* list_type
*/
struct __pyx_obj_7pyarrow_3lib_ListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ListType const *list_type;
};


/* "pyarrow/lib.pxd":93
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListType* list_type
*/
struct __pyx_obj_7pyarrow_3lib_LargeListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::LargeListType const *list_type;
};


/* "pyarrow/lib.pxd":98
 * 
 * 
 * cdef class ListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListViewType* list_view_type
*/
struct __pyx_obj_7pyarrow_3lib_ListViewType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ListViewType const *list_view_type;
};


/* "pyarrow/lib.pxd":103
 * 
 * 
 * cdef class LargeListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListViewType* list_view_type
*/
struct __pyx_obj_7pyarrow_3lib_LargeListViewType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::LargeListViewType const *list_view_type;
};


/* "pyarrow/lib.pxd":108
 * 
 * 
 * cdef class MapType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CMapType* map_type
*/
struct __pyx_obj_7pyarrow_3lib_MapType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::MapType const *map_type;
};


/* "pyarrow/lib.pxd":113
 * 
 * 
 * cdef class FixedSizeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeListType* list_type
*/
struct __pyx_obj_7pyarrow_3lib_FixedSizeListType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::FixedSizeListType const *list_type;
};


/* "pyarrow/lib.pxd":118
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CStructType* struct_type
*/
struct __pyx_obj_7pyarrow_3lib_StructType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::StructType const *struct_type;
};


/* "pyarrow/lib.pxd":125
 * 
 * 
 * cdef class DictionaryMemo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Even though the CDictionaryMemo instance is private, we allocate
*/
struct __pyx_obj_7pyarrow_3lib_DictionaryMemo {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::shared_ptr< arrow::ipc::DictionaryMemo>  sp_memo;
   arrow::ipc::DictionaryMemo *memo;
};


/* "pyarrow/lib.pxd":133
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDictionaryType* dict_type
*/
struct __pyx_obj_7pyarrow_3lib_DictionaryType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::DictionaryType const *dict_type;
};


/* "pyarrow/lib.pxd":138
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTimestampType* ts_type
*/
struct __pyx_obj_7pyarrow_3lib_TimestampType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::TimestampType const *ts_type;
};


/* "pyarrow/lib.pxd":143
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime32Type* time_type
*/
struct __pyx_obj_7pyarrow_3lib_Time32Type {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::Time32Type const *time_type;
};


/* "pyarrow/lib.pxd":148
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime64Type* time_type
*/
struct __pyx_obj_7pyarrow_3lib_Time64Type {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::Time64Type const *time_type;
};


/* "pyarrow/lib.pxd":153
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDurationType* duration_type
*/
struct __pyx_obj_7pyarrow_3lib_DurationType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::DurationType const *duration_type;
};


/* "pyarrow/lib.pxd":158
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeBinaryType* fixed_size_binary_type
*/
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::FixedSizeBinaryType const *fixed_size_binary_type;
};


/* "pyarrow/lib.pxd":163
 * 
 * 
 * cdef class Decimal32Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal32Type* decimal32_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal32Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal32Type const *decimal32_type;
};


/* "pyarrow/lib.pxd":168
 * 
 * 
 * cdef class Decimal64Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal64Type* decimal64_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal64Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal64Type const *decimal64_type;
};


/* "pyarrow/lib.pxd":173
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal128Type* decimal128_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal128Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal128Type const *decimal128_type;
};


/* "pyarrow/lib.pxd":178
 * 
 * 
 * cdef class Decimal256Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal256Type* decimal256_type
*/
struct __pyx_obj_7pyarrow_3lib_Decimal256Type {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
   arrow::Decimal256Type const *decimal256_type;
};


/* "pyarrow/lib.pxd":183
 * 
 * 
 * cdef class RunEndEncodedType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CRunEndEncodedType* run_end_encoded_type
*/
struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::RunEndEncodedType const *run_end_encoded_type;
};


/* "pyarrow/lib.pxd":188
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CExtensionType* ext_type
*/
struct __pyx_obj_7pyarrow_3lib_BaseExtensionType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
   arrow::ExtensionType const *ext_type;
};


/* "pyarrow/lib.pxd":193
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CPyExtensionType* cpy_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_ExtensionType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::py::PyExtensionType const *cpy_ext_type;
};


/* "pyarrow/lib.pxd":198
 * 
 * 
 * cdef class FixedShapeTensorType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedShapeTensorType* tensor_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::FixedShapeTensorType const *tensor_ext_type;
};


/* "pyarrow/lib.pxd":202
 *         const CFixedShapeTensorType* tensor_ext_type
 * 
 * cdef class Bool8Type(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CBool8Type* bool8_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_Bool8Type {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::Bool8Type const *bool8_ext_type;
};


/* "pyarrow/lib.pxd":206
 *         const CBool8Type* bool8_ext_type
 * 
 * cdef class OpaqueType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const COpaqueType* opaque_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_OpaqueType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::OpaqueType const *opaque_ext_type;
};


/* "pyarrow/lib.pxd":210
 *         const COpaqueType* opaque_ext_type
 * 
 * cdef class UuidType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CUuidType* uuid_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_UuidType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::UuidType const *uuid_ext_type;
};


/* "pyarrow/lib.pxd":214
 *         const CUuidType* uuid_ext_type
 * 
 * cdef class JsonType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CJsonType* json_ext_type
*/
struct __pyx_obj_7pyarrow_3lib_JsonType {
  struct __pyx_obj_7pyarrow_3lib_BaseExtensionType __pyx_base;
   arrow::extension::JsonExtensionType const *json_ext_type;
};


/* "pyarrow/lib.pxd":219
 * 
 * 
 * cdef class _Metadata(_Weakrefable):             # <<<<<<<<<<<<<<
 *     # required because KeyValueMetadata also extends collections.abc.Mapping
 *     # and the first parent class must be an extension type
*/
struct __pyx_obj_7pyarrow_3lib__Metadata {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/lib.pxd":225
 * 
 * 
 * cdef class KeyValueMetadata(_Metadata):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[const CKeyValueMetadata] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata {
  struct __pyx_obj_7pyarrow_3lib__Metadata __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata *__pyx_vtab;
  std::shared_ptr< arrow::KeyValueMetadata const >  wrapped;
   arrow::KeyValueMetadata const *metadata;
};


/* "pyarrow/lib.pxd":237
 * 
 * 
 * cdef class Field(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
*/
struct __pyx_obj_7pyarrow_3lib_Field {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Field *__pyx_vtab;
  std::shared_ptr< arrow::Field>  sp_field;
   arrow::Field *field;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":248
 * 
 * 
 * cdef class Schema(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
*/
struct __pyx_obj_7pyarrow_3lib_Schema {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtab;
  std::shared_ptr< arrow::Schema>  sp_schema;
   arrow::Schema *schema;
};


/* "pyarrow/lib.pxd":257
 * 
 * 
 * cdef class Scalar(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_Scalar {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Scalar *__pyx_vtab;
  std::shared_ptr< arrow::Scalar>  wrapped;
};


/* "pyarrow/lib.pxd":269
 * 
 * 
 * cdef class ArrayStatistics(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArrayStatistics] sp_statistics
*/
struct __pyx_obj_7pyarrow_3lib_ArrayStatistics {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics *__pyx_vtab;
  std::shared_ptr< arrow::ArrayStatistics>  sp_statistics;
};


/* "pyarrow/lib.pxd":277
 * 
 * 
 * cdef class _PandasConvertible(_Weakrefable):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib__PandasConvertible {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/lib.pxd":281
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
*/
struct __pyx_obj_7pyarrow_3lib_Array {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtab;
  std::shared_ptr< arrow::Array>  sp_array;
   arrow::Array *ap;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":297
 * 
 * 
 * cdef class Tensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_tensor
*/
struct __pyx_obj_7pyarrow_3lib_Tensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *__pyx_vtab;
  std::shared_ptr< arrow::Tensor>  sp_tensor;
   arrow::Tensor *tp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
  PyObject *_ssize_t_shape;
  PyObject *_ssize_t_strides;
};


/* "pyarrow/lib.pxd":310
 * 
 * 
 * cdef class SparseCSRMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSRMatrix] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSRMatrix>  sp_sparse_tensor;
   arrow::SparseCSRMatrix *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":321
 * 
 * 
 * cdef class SparseCSCMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSCMatrix] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSCMatrix>  sp_sparse_tensor;
   arrow::SparseCSCMatrix *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":332
 * 
 * 
 * cdef class SparseCOOTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCOOTensor] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *__pyx_vtab;
  std::shared_ptr< arrow::SparseCOOTensor>  sp_sparse_tensor;
   arrow::SparseCOOTensor *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":343
 * 
 * 
 * cdef class SparseCSFTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSFTensor] sp_sparse_tensor
*/
struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor *__pyx_vtab;
  std::shared_ptr< arrow::SparseCSFTensor>  sp_sparse_tensor;
   arrow::SparseCSFTensor *stp;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":354
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_NullArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":358
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BooleanArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":362
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_NumericArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":366
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_IntegerArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/lib.pxd":370
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_FloatingPointArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/lib.pxd":374
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Int8Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":378
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_UInt8Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":382
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Int16Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":386
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_UInt16Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":390
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Int32Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":394
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_UInt32Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":398
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Int64Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":402
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_UInt64Array {
  struct __pyx_obj_7pyarrow_3lib_IntegerArray __pyx_base;
};


/* "pyarrow/lib.pxd":406
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_HalfFloatArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":410
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_FloatArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":414
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_DoubleArray {
  struct __pyx_obj_7pyarrow_3lib_FloatingPointArray __pyx_base;
};


/* "pyarrow/lib.pxd":418
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":422
 * 
 * 
 * cdef class Decimal32Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal32Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":426
 * 
 * 
 * cdef class Decimal64Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal64Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":430
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal128Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":434
 * 
 * 
 * cdef class Decimal256Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_Decimal256Array {
  struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};


/* "pyarrow/lib.pxd":438
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_StructArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":442
 * 
 * 
 * cdef class BaseListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BaseListArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":446
 * 
 * 
 * cdef class ListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":450
 * 
 * 
 * cdef class LargeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_LargeListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":454
 * 
 * 
 * cdef class ListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ListViewArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":458
 * 
 * 
 * cdef class LargeListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_LargeListViewArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":462
 * 
 * 
 * cdef class MapArray(ListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_MapArray {
  struct __pyx_obj_7pyarrow_3lib_ListArray __pyx_base;
};


/* "pyarrow/lib.pxd":466
 * 
 * 
 * cdef class FixedSizeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray {
  struct __pyx_obj_7pyarrow_3lib_BaseListArray __pyx_base;
};


/* "pyarrow/lib.pxd":470
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_UnionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":474
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_StringArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":478
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BinaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":482
 * 
 * 
 * cdef class StringViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_StringViewArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":486
 * 
 * 
 * cdef class BinaryViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BinaryViewArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":490
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _indices, _dictionary
*/
struct __pyx_obj_7pyarrow_3lib_DictionaryArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
  PyObject *_indices;
  PyObject *_dictionary;
};


/* "pyarrow/lib.pxd":495
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_ExtensionArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":499
 * 
 * 
 * cdef class MonthDayNanoIntervalArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


/* "pyarrow/lib.pxd":507
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
*/
struct __pyx_obj_7pyarrow_3lib_ChunkedArray {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtab;
  std::shared_ptr< arrow::ChunkedArray>  sp_chunked_array;
   arrow::ChunkedArray *chunked_array;
  bool _is_cpu;
  bool _init_is_cpu;
  PyObject *_name;
};


/* "pyarrow/lib.pxd":522
 * 
 * 
 * cdef class _Tabular(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef void _assert_cpu(self) except *
 * 
*/
struct __pyx_obj_7pyarrow_3lib__Tabular {
  struct __pyx_obj_7pyarrow_3lib__PandasConvertible __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular *__pyx_vtab;
};


/* "pyarrow/lib.pxd":526
 * 
 * 
 * cdef class Table(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
*/
struct __pyx_obj_7pyarrow_3lib_Table {
  struct __pyx_obj_7pyarrow_3lib__Tabular __pyx_base;
  std::shared_ptr< arrow::Table>  sp_table;
   arrow::Table *table;
  bool _is_cpu;
  bool _init_is_cpu;
};


/* "pyarrow/lib.pxd":536
 * 
 * 
 * cdef class RecordBatch(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatch] sp_batch
*/
struct __pyx_obj_7pyarrow_3lib_RecordBatch {
  struct __pyx_obj_7pyarrow_3lib__Tabular __pyx_base;
  std::shared_ptr< arrow::RecordBatch>  sp_batch;
   arrow::RecordBatch *batch;
  struct __pyx_obj_7pyarrow_3lib_Schema *_schema;
};


/* "pyarrow/lib.pxd":545
 * 
 * 
 * cdef class Device(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDevice] device
*/
struct __pyx_obj_7pyarrow_3lib_Device {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Device *__pyx_vtab;
  std::shared_ptr< arrow::Device>  device;
};


/* "pyarrow/lib.pxd":557
 * 
 * 
 * cdef class MemoryManager(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CMemoryManager] memory_manager
*/
struct __pyx_obj_7pyarrow_3lib_MemoryManager {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager *__pyx_vtab;
  std::shared_ptr< arrow::MemoryManager>  memory_manager;
};


/* "pyarrow/lib.pxd":569
 * 
 * 
 * cdef class Buffer(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
*/
struct __pyx_obj_7pyarrow_3lib_Buffer {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *__pyx_vtab;
  std::shared_ptr< arrow::Buffer>  buffer;
  Py_ssize_t shape[1];
  Py_ssize_t strides[1];
};


/* "pyarrow/lib.pxd":579
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer)
*/
struct __pyx_obj_7pyarrow_3lib_ResizableBuffer {
  struct __pyx_obj_7pyarrow_3lib_Buffer __pyx_base;
};


/* "pyarrow/lib.pxd":584
 * 
 * 
 * cdef class NativeFile(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] input_stream
*/
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtab;
  std::shared_ptr< arrow::io::InputStream>  input_stream;
  std::shared_ptr< arrow::io::RandomAccessFile>  random_access;
  std::shared_ptr< arrow::io::OutputStream>  output_stream;
  int is_readable;
  int is_writable;
  int is_seekable;
  int _is_appending;
  int own_file;
};


/* "pyarrow/lib.pxd":608
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BufferedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":612
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":616
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_CompressedInputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":620
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/
struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/lib.pxd":624
 * 
 * 
 * cdef class _CRecordBatchWriter(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         SharedPtrNoGIL[CRecordBatchWriter] writer
*/
struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  arrow::py::SharedPtrNoGIL< arrow::ipc::RecordBatchWriter>  writer;
};


/* "pyarrow/lib.pxd":629
 * 
 * 
 * cdef class RecordBatchReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         SharedPtrNoGIL[CRecordBatchReader] reader
*/
struct __pyx_obj_7pyarrow_3lib_RecordBatchReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  arrow::py::SharedPtrNoGIL< arrow::RecordBatchReader>  reader;
};


/* "pyarrow/lib.pxd":634
 * 
 * 
 * cdef class CacheOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCacheOptions wrapped
*/
struct __pyx_obj_7pyarrow_3lib_CacheOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions *__pyx_vtab;
  arrow::io::CacheOptions wrapped;
};


/* "pyarrow/lib.pxd":646
 * 
 * 
 * cdef class Codec(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CCodec] wrapped
*/
struct __pyx_obj_7pyarrow_3lib_Codec {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_3lib_Codec *__pyx_vtab;
  std::shared_ptr< arrow::util::Codec>  wrapped;
};


/* "pyarrow/lib.pxd":654
 * 
 * # This class is only used internally for now
 * cdef class StopToken:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStopToken stop_token
*/
struct __pyx_obj_7pyarrow_3lib_StopToken {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_StopToken *__pyx_vtab;
  arrow::StopToken stop_token;
};


/* "pyarrow/_flight.pyx":100
 * 
 * 
 * cdef class FlightCallOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """RPC-layer options for a Flight call."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCallOptions *__pyx_vtab;
   arrow::flight::FlightCallOptions options;
};


/* "pyarrow/_flight.pyx":184
 * 
 * 
 * cdef class FlightError(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for Flight-specific errors.
*/
struct __pyx_obj_7pyarrow_7_flight_FlightError {
  PyBaseExceptionObject __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *__pyx_vtab;
  PyObject *__dict__;
};


/* "pyarrow/_flight.pyx":217
 * 
 * 
 * cdef class FlightInternalError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """An error internal to the Flight server occurred."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightInternalError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":225
 * 
 * 
 * cdef class FlightTimedOutError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The Flight RPC call timed out."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":233
 * 
 * 
 * cdef class FlightCancelledError(FlightError, ArrowCancelled):             # <<<<<<<<<<<<<<
 *     """The operation was cancelled."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":241
 * 
 * 
 * cdef class FlightServerError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """A server error occurred."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightServerError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":249
 * 
 * 
 * cdef class FlightUnauthenticatedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authenticated."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":257
 * 
 * 
 * cdef class FlightUnauthorizedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authorized to perform the given operation."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":265
 * 
 * 
 * cdef class FlightUnavailableError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The server is not reachable or available."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError {
  struct __pyx_obj_7pyarrow_7_flight_FlightError __pyx_base;
};


/* "pyarrow/_flight.pyx":282
 * 
 * 
 * cdef class Action(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An action executable on a Flight service."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_Action {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_Action *__pyx_vtab;
   arrow::flight::Action action;
};


/* "pyarrow/_flight.pyx":361
 * 
 * 
 * cdef class Result(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A result from executing an Action."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_Result {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::flight::Result>  result;
};


/* "pyarrow/_flight.pyx":410
 * 
 * 
 * cdef class BasicAuth(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A container for basic auth."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_BasicAuth {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::flight::BasicAuth>  basic_auth;
};


/* "pyarrow/_flight.pyx":517
 * 
 * 
 * cdef class FlightDescriptor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A description of a data stream available from a Flight service."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDescriptor *__pyx_vtab;
   arrow::flight::FlightDescriptor descriptor;
};


/* "pyarrow/_flight.pyx":612
 * 
 * 
 * cdef class Ticket(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A ticket for requesting a Flight stream."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_Ticket {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::flight::Ticket c_ticket;
};


/* "pyarrow/_flight.pyx":654
 * 
 * 
 * cdef class Location(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """The location of a Flight service."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_Location {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_Location *__pyx_vtab;
   arrow::flight::Location location;
};


/* "pyarrow/_flight.pyx":726
 * 
 * 
 * cdef class FlightEndpoint(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A Flight stream, along with the ticket and locations to access it."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::flight::FlightEndpoint endpoint;
};


/* "pyarrow/_flight.pyx":851
 * 
 * 
 * cdef class SchemaResult(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """The serialized schema returned from a GetSchema request."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_SchemaResult {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::flight::SchemaResult>  result;
};


/* "pyarrow/_flight.pyx":907
 * 
 * 
 * cdef class FlightInfo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A description of a Flight stream."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_FlightInfo {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightInfo *__pyx_vtab;
  std::unique_ptr< arrow::flight::FlightInfo>  info;
};


/* "pyarrow/_flight.pyx":1057
 * 
 * 
 * cdef class FlightStreamChunk(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A RecordBatch with application metadata on the side."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
   arrow::flight::FlightStreamChunk chunk;
};


/* "pyarrow/_flight.pyx":1081
 * 
 * 
 * cdef class _MetadataRecordBatchReader(_Weakrefable, _ReadPandasMixin):             # <<<<<<<<<<<<<<
 *     """A reader for Flight streams."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  PyObject *__dict__;
  std::shared_ptr< arrow::flight::MetadataRecordBatchReader>  reader;
};


/* "pyarrow/_flight.pyx":1166
 * 
 * 
 * cdef class MetadataRecordBatchReader(_MetadataRecordBatchReader):             # <<<<<<<<<<<<<<
 *     """The base class for readers for Flight streams.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader {
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader __pyx_base;
};


/* "pyarrow/_flight.pyx":1175
 * 
 * 
 * cdef class FlightStreamReader(MetadataRecordBatchReader):             # <<<<<<<<<<<<<<
 *     """A reader that can also be canceled."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader __pyx_base;
};


/* "pyarrow/_flight.pyx":1197
 * 
 * 
 * cdef class MetadataRecordBatchWriter(_CRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     """A RecordBatchWriter that also allows writing application metadata.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter {
  struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":1295
 * 
 * 
 * cdef class FlightStreamWriter(MetadataRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     """A writer that also allows closing the write side of a stream."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter __pyx_base;
};


/* "pyarrow/_flight.pyx":1305
 * 
 * 
 * cdef class FlightMetadataReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A reader for Flight metadata messages sent during a DoPut."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::flight::FlightMetadataReader>  reader;
};


/* "pyarrow/_flight.pyx":1321
 * 
 * 
 * cdef class FlightMetadataWriter(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A sender for Flight metadata messages during a DoPut."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::unique_ptr< arrow::flight::FlightMetadataWriter>  writer;
};


/* "pyarrow/_flight.pyx":1362
 * 
 * 
 * cdef class AsyncioFlightClient:             # <<<<<<<<<<<<<<
 *     """
 *     A FlightClient with an asyncio-based async interface.
*/
struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_7_flight_AsyncioFlightClient *__pyx_vtab;
  struct __pyx_obj_7pyarrow_7_flight_FlightClient *_client;
};


/* "pyarrow/_flight.pyx":1400
 * 
 * 
 * cdef class FlightClient(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A client to a Flight service.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightClient {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightClient *__pyx_vtab;
  std::unique_ptr< arrow::flight::FlightClient>  client;
};


/* "pyarrow/_flight.pyx":1829
 * 
 * 
 * cdef class FlightDataStream(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     Abstract base class for Flight data streams.
*/
struct __pyx_obj_7pyarrow_7_flight_FlightDataStream {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":1848
 * 
 * 
 * cdef class RecordBatchStream(FlightDataStream):             # <<<<<<<<<<<<<<
 *     """A Flight data stream backed by RecordBatches.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream {
  struct __pyx_obj_7pyarrow_7_flight_FlightDataStream __pyx_base;
  PyObject *data_source;
   arrow::ipc::IpcWriteOptions write_options;
};


/* "pyarrow/_flight.pyx":1890
 * 
 * 
 * cdef class GeneratorStream(FlightDataStream):             # <<<<<<<<<<<<<<
 *     """A Flight data stream backed by a Python generator."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_GeneratorStream {
  struct __pyx_obj_7pyarrow_7_flight_FlightDataStream __pyx_base;
  std::shared_ptr< arrow::Schema>  schema;
  PyObject *generator;
  std::unique_ptr< arrow::flight::FlightDataStream>  current_stream;
   arrow::ipc::IpcWriteOptions c_options;
};


/* "pyarrow/_flight.pyx":1925
 * 
 * 
 * cdef class ServerCallContext(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Per-call state/context."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_ServerCallContext {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerCallContext *__pyx_vtab;
   arrow::flight::ServerCallContext const *context;
};


/* "pyarrow/_flight.pyx":1989
 * 
 * 
 * cdef class ServerAuthReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A reader for messages from the client during an auth handshake."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader *__pyx_vtab;
   arrow::flight::ServerAuthReader *reader;
};


/* "pyarrow/_flight.pyx":2020
 * 
 * 
 * cdef class ServerAuthSender(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A writer for messages to the client during an auth handshake."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender *__pyx_vtab;
   arrow::flight::ServerAuthSender *sender;
};


/* "pyarrow/_flight.pyx":2050
 * 
 * 
 * cdef class ClientAuthReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A reader for messages from the server during an auth handshake."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader *__pyx_vtab;
   arrow::flight::ClientAuthReader *reader;
};


/* "pyarrow/_flight.pyx":2081
 * 
 * 
 * cdef class ClientAuthSender(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A writer for messages to the server during an auth handshake."""
 *     cdef:
*/
struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender *__pyx_vtab;
   arrow::flight::ClientAuthSender *sender;
};


/* "pyarrow/_flight.pyx":2545
 * 
 * 
 * cdef class ServerAuthHandler(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Authentication middleware for a server.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthHandler *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":2589
 * 
 * 
 * cdef class ClientAuthHandler(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Authentication plugin for a client."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthHandler *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":2627
 * 
 * 
 * cdef class ClientMiddlewareFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A factory for new middleware instances.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/_flight.pyx":2655
 * 
 * 
 * cdef class ClientMiddleware(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Client-side middleware for a call, instantiated per RPC.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ClientMiddleware *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":2718
 * 
 * 
 * cdef class ServerMiddlewareFactory(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A factory for new middleware instances.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
};


/* "pyarrow/_flight.pyx":2756
 * 
 * 
 * cdef class TracingServerMiddlewareFactory(ServerMiddlewareFactory):             # <<<<<<<<<<<<<<
 *     """A factory for tracing middleware instances.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory {
  struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory __pyx_base;
};


/* "pyarrow/_flight.pyx":2772
 * 
 * 
 * cdef class ServerMiddleware(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Server-side middleware for a call, instantiated per RPC.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerMiddleware *__pyx_vtab;
};


/* "pyarrow/_flight.pyx":2825
 * 
 * 
 * cdef class _ServerMiddlewareFactoryWrapper(ServerMiddlewareFactory):             # <<<<<<<<<<<<<<
 *     """Wrapper to bundle server middleware into a single C++ one."""
 * 
*/
struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper {
  struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory __pyx_base;
  PyObject *factories;
};


/* "pyarrow/_flight.pyx":2846
 * 
 * 
 * cdef class _ServerMiddlewareWrapper(ServerMiddleware):             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict middleware
*/
struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper {
  struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware __pyx_base;
  PyObject *middleware;
};


/* "pyarrow/_flight.pyx":2874
 * 
 * 
 * cdef class _FlightServerFinalizer(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     A finalizer that shuts down the server on destruction.
*/
struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  std::shared_ptr<arrow::py::flight::PyFlightServer>  server;
};


/* "pyarrow/_flight.pyx":2901
 * 
 * 
 * cdef class FlightServerBase(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A Flight service definition.
 * 
*/
struct __pyx_obj_7pyarrow_7_flight_FlightServerBase {
  struct __pyx_obj_7pyarrow_3lib__Weakrefable __pyx_base;
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerBase *__pyx_vtab;
  std::shared_ptr<arrow::py::flight::PyFlightServer>  server;
  PyObject *finalizer;
};


/* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info {
  PyObject_HEAD
  PyObject *__pyx_v_call;
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options;
  struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self;
};


/* "pyarrow/_flight.pyx":1629
 *             return result
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """
 *         Execute an action on a service.
*/
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action {
  PyObject_HEAD
  std::unique_ptr< arrow::flight::ResultStream>  __pyx_v_results;
};


/* "pyarrow/_flight.pyx":1662
 *                     deref(c_options), c_action).Value(&results))
 * 
 *         def _do_action_response():             # <<<<<<<<<<<<<<
 *             cdef:
 *                 Result result
*/
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *__pyx_outer_scope;
  struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_result;
};


/* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights {
  PyObject_HEAD
   arrow::flight::Criteria __pyx_v_c_criteria;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
  PyObject *__pyx_v_criteria;
  std::unique_ptr< arrow::flight::FlightListing>  __pyx_v_listing;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options;
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_result;
  struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self;
  PyObject *__pyx_v_stop_handler;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
};



/* "pyarrow/lib.pxd":65
 * 
 * 
 * cdef class MemoryPool(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CMemoryPool* pool
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_MemoryPool *,  arrow::MemoryPool *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool *__pyx_vtabptr_7pyarrow_3lib_MemoryPool;


/* "pyarrow/lib.pxd":78
 * 
 * 
 * cdef class DataType(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDataType] sp_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_DataType {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::DataType>  const &);
  struct __pyx_obj_7pyarrow_3lib_Field *(*field)(struct __pyx_obj_7pyarrow_3lib_DataType *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DataType *__pyx_vtabptr_7pyarrow_3lib_DataType;


/* "pyarrow/lib.pxd":88
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListType* list_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListType *__pyx_vtabptr_7pyarrow_3lib_ListType;


/* "pyarrow/lib.pxd":93
 * 
 * 
 * cdef class LargeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListType* list_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType *__pyx_vtabptr_7pyarrow_3lib_LargeListType;


/* "pyarrow/lib.pxd":98
 * 
 * 
 * cdef class ListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CListViewType* list_view_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType *__pyx_vtabptr_7pyarrow_3lib_ListViewType;


/* "pyarrow/lib.pxd":103
 * 
 * 
 * cdef class LargeListViewType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CLargeListViewType* list_view_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType *__pyx_vtabptr_7pyarrow_3lib_LargeListViewType;


/* "pyarrow/lib.pxd":108
 * 
 * 
 * cdef class MapType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CMapType* map_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MapType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapType *__pyx_vtabptr_7pyarrow_3lib_MapType;


/* "pyarrow/lib.pxd":113
 * 
 * 
 * cdef class FixedSizeListType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeListType* list_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType *__pyx_vtabptr_7pyarrow_3lib_FixedSizeListType;


/* "pyarrow/lib.pxd":118
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CStructType* struct_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StructType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
  struct __pyx_obj_7pyarrow_3lib_Field *(*field_by_name)(struct __pyx_obj_7pyarrow_3lib_StructType *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructType *__pyx_vtabptr_7pyarrow_3lib_StructType;


/* "pyarrow/lib.pxd":133
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDictionaryType* dict_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType *__pyx_vtabptr_7pyarrow_3lib_DictionaryType;


/* "pyarrow/lib.pxd":138
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTimestampType* ts_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType *__pyx_vtabptr_7pyarrow_3lib_TimestampType;


/* "pyarrow/lib.pxd":143
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime32Type* time_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type *__pyx_vtabptr_7pyarrow_3lib_Time32Type;


/* "pyarrow/lib.pxd":148
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CTime64Type* time_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type *__pyx_vtabptr_7pyarrow_3lib_Time64Type;


/* "pyarrow/lib.pxd":153
 * 
 * 
 * cdef class DurationType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDurationType* duration_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_DurationType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DurationType *__pyx_vtabptr_7pyarrow_3lib_DurationType;


/* "pyarrow/lib.pxd":158
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedSizeBinaryType* fixed_size_binary_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType;


/* "pyarrow/lib.pxd":163
 * 
 * 
 * cdef class Decimal32Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal32Type* decimal32_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type *__pyx_vtabptr_7pyarrow_3lib_Decimal32Type;


/* "pyarrow/lib.pxd":168
 * 
 * 
 * cdef class Decimal64Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal64Type* decimal64_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type *__pyx_vtabptr_7pyarrow_3lib_Decimal64Type;


/* "pyarrow/lib.pxd":173
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal128Type* decimal128_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type *__pyx_vtabptr_7pyarrow_3lib_Decimal128Type;


/* "pyarrow/lib.pxd":178
 * 
 * 
 * cdef class Decimal256Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CDecimal256Type* decimal256_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type *__pyx_vtabptr_7pyarrow_3lib_Decimal256Type;


/* "pyarrow/lib.pxd":183
 * 
 * 
 * cdef class RunEndEncodedType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CRunEndEncodedType* run_end_encoded_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType *__pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType;


/* "pyarrow/lib.pxd":188
 * 
 * 
 * cdef class BaseExtensionType(DataType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CExtensionType* ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType *__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType;


/* "pyarrow/lib.pxd":193
 * 
 * 
 * cdef class ExtensionType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CPyExtensionType* cpy_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType *__pyx_vtabptr_7pyarrow_3lib_ExtensionType;


/* "pyarrow/lib.pxd":198
 * 
 * 
 * cdef class FixedShapeTensorType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CFixedShapeTensorType* tensor_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType *__pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType;


/* "pyarrow/lib.pxd":202
 *         const CFixedShapeTensorType* tensor_ext_type
 * 
 * cdef class Bool8Type(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CBool8Type* bool8_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type *__pyx_vtabptr_7pyarrow_3lib_Bool8Type;


/* "pyarrow/lib.pxd":206
 *         const CBool8Type* bool8_ext_type
 * 
 * cdef class OpaqueType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const COpaqueType* opaque_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType *__pyx_vtabptr_7pyarrow_3lib_OpaqueType;


/* "pyarrow/lib.pxd":210
 *         const COpaqueType* opaque_ext_type
 * 
 * cdef class UuidType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CUuidType* uuid_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UuidType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UuidType *__pyx_vtabptr_7pyarrow_3lib_UuidType;


/* "pyarrow/lib.pxd":214
 *         const CUuidType* uuid_ext_type
 * 
 * cdef class JsonType(BaseExtensionType):             # <<<<<<<<<<<<<<
 *     cdef:
 *         const CJsonType* json_ext_type
*/

struct __pyx_vtabstruct_7pyarrow_3lib_JsonType {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_JsonType *__pyx_vtabptr_7pyarrow_3lib_JsonType;


/* "pyarrow/lib.pxd":225
 * 
 * 
 * cdef class KeyValueMetadata(_Metadata):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[const CKeyValueMetadata] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata *, std::shared_ptr< arrow::KeyValueMetadata const >  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::KeyValueMetadata const >  const &);
  std::shared_ptr< arrow::KeyValueMetadata const >  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata *__pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata;


/* "pyarrow/lib.pxd":237
 * 
 * 
 * cdef class Field(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CField] sp_field
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Field {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Field *, std::shared_ptr< arrow::Field>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Field *__pyx_vtabptr_7pyarrow_3lib_Field;


/* "pyarrow/lib.pxd":248
 * 
 * 
 * cdef class Schema(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSchema] sp_schema
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Schema {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::vector<std::shared_ptr< arrow::Field> >  const &);
  void (*init_schema)(struct __pyx_obj_7pyarrow_3lib_Schema *, std::shared_ptr< arrow::Schema>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Schema *__pyx_vtabptr_7pyarrow_3lib_Schema;


/* "pyarrow/lib.pxd":257
 * 
 * 
 * cdef class Scalar(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CScalar] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Scalar {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Scalar *, std::shared_ptr< arrow::Scalar>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::Scalar>  const &);
  std::shared_ptr< arrow::Scalar>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_Scalar *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Scalar *__pyx_vtabptr_7pyarrow_3lib_Scalar;


/* "pyarrow/lib.pxd":269
 * 
 * 
 * cdef class ArrayStatistics(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArrayStatistics] sp_statistics
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics *, std::shared_ptr< arrow::ArrayStatistics>  const &);
  PyObject *(*_get_value)(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics *, std::optional< std::variant<bool, int64_t, uint64_t, double, std::string>>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics *__pyx_vtabptr_7pyarrow_3lib_ArrayStatistics;


/* "pyarrow/lib.pxd":281
 * 
 * 
 * cdef class Array(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Array {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Array *, std::shared_ptr< arrow::Array>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_Array *, int64_t);
  int64_t (*length)(struct __pyx_obj_7pyarrow_3lib_Array *);
  void (*_assert_cpu)(struct __pyx_obj_7pyarrow_3lib_Array *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtabptr_7pyarrow_3lib_Array;


/* "pyarrow/lib.pxd":297
 * 
 * 
 * cdef class Tensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTensor] sp_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Tensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Tensor *, std::shared_ptr< arrow::Tensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Tensor *__pyx_vtabptr_7pyarrow_3lib_Tensor;


/* "pyarrow/lib.pxd":310
 * 
 * 
 * cdef class SparseCSRMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSRMatrix] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix *, std::shared_ptr< arrow::SparseCSRMatrix>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix *__pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix;


/* "pyarrow/lib.pxd":321
 * 
 * 
 * cdef class SparseCSCMatrix(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSCMatrix] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix *, std::shared_ptr< arrow::SparseCSCMatrix>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix *__pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix;


/* "pyarrow/lib.pxd":332
 * 
 * 
 * cdef class SparseCOOTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCOOTensor] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor *, std::shared_ptr< arrow::SparseCOOTensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor *__pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor;


/* "pyarrow/lib.pxd":343
 * 
 * 
 * cdef class SparseCSFTensor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CSparseCSFTensor] sp_sparse_tensor
*/

struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor *, std::shared_ptr< arrow::SparseCSFTensor>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor *__pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor;


/* "pyarrow/lib.pxd":354
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_NullArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NullArray *__pyx_vtabptr_7pyarrow_3lib_NullArray;


/* "pyarrow/lib.pxd":358
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray *__pyx_vtabptr_7pyarrow_3lib_BooleanArray;


/* "pyarrow/lib.pxd":362
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray *__pyx_vtabptr_7pyarrow_3lib_NumericArray;


/* "pyarrow/lib.pxd":366
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray *__pyx_vtabptr_7pyarrow_3lib_IntegerArray;


/* "pyarrow/lib.pxd":370
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray *__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray;


/* "pyarrow/lib.pxd":374
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array *__pyx_vtabptr_7pyarrow_3lib_Int8Array;


/* "pyarrow/lib.pxd":378
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array *__pyx_vtabptr_7pyarrow_3lib_UInt8Array;


/* "pyarrow/lib.pxd":382
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array *__pyx_vtabptr_7pyarrow_3lib_Int16Array;


/* "pyarrow/lib.pxd":386
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array *__pyx_vtabptr_7pyarrow_3lib_UInt16Array;


/* "pyarrow/lib.pxd":390
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array *__pyx_vtabptr_7pyarrow_3lib_Int32Array;


/* "pyarrow/lib.pxd":394
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array *__pyx_vtabptr_7pyarrow_3lib_UInt32Array;


/* "pyarrow/lib.pxd":398
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array *__pyx_vtabptr_7pyarrow_3lib_Int64Array;


/* "pyarrow/lib.pxd":402
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array *__pyx_vtabptr_7pyarrow_3lib_UInt64Array;


/* "pyarrow/lib.pxd":406
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray *__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray;


/* "pyarrow/lib.pxd":410
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray *__pyx_vtabptr_7pyarrow_3lib_FloatArray;


/* "pyarrow/lib.pxd":414
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray *__pyx_vtabptr_7pyarrow_3lib_DoubleArray;


/* "pyarrow/lib.pxd":418
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray *__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray;


/* "pyarrow/lib.pxd":422
 * 
 * 
 * cdef class Decimal32Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array *__pyx_vtabptr_7pyarrow_3lib_Decimal32Array;


/* "pyarrow/lib.pxd":426
 * 
 * 
 * cdef class Decimal64Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array *__pyx_vtabptr_7pyarrow_3lib_Decimal64Array;


/* "pyarrow/lib.pxd":430
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array *__pyx_vtabptr_7pyarrow_3lib_Decimal128Array;


/* "pyarrow/lib.pxd":434
 * 
 * 
 * cdef class Decimal256Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array {
  struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array *__pyx_vtabptr_7pyarrow_3lib_Decimal256Array;


/* "pyarrow/lib.pxd":438
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StructArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructArray *__pyx_vtabptr_7pyarrow_3lib_StructArray;


/* "pyarrow/lib.pxd":442
 * 
 * 
 * cdef class BaseListArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray *__pyx_vtabptr_7pyarrow_3lib_BaseListArray;


/* "pyarrow/lib.pxd":446
 * 
 * 
 * cdef class ListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListArray *__pyx_vtabptr_7pyarrow_3lib_ListArray;


/* "pyarrow/lib.pxd":450
 * 
 * 
 * cdef class LargeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray *__pyx_vtabptr_7pyarrow_3lib_LargeListArray;


/* "pyarrow/lib.pxd":454
 * 
 * 
 * cdef class ListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray *__pyx_vtabptr_7pyarrow_3lib_ListViewArray;


/* "pyarrow/lib.pxd":458
 * 
 * 
 * cdef class LargeListViewArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray *__pyx_vtabptr_7pyarrow_3lib_LargeListViewArray;


/* "pyarrow/lib.pxd":462
 * 
 * 
 * cdef class MapArray(ListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MapArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_ListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MapArray *__pyx_vtabptr_7pyarrow_3lib_MapArray;


/* "pyarrow/lib.pxd":466
 * 
 * 
 * cdef class FixedSizeListArray(BaseListArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray *__pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray;


/* "pyarrow/lib.pxd":470
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray *__pyx_vtabptr_7pyarrow_3lib_UnionArray;


/* "pyarrow/lib.pxd":474
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StringArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringArray *__pyx_vtabptr_7pyarrow_3lib_StringArray;


/* "pyarrow/lib.pxd":478
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray *__pyx_vtabptr_7pyarrow_3lib_BinaryArray;


/* "pyarrow/lib.pxd":482
 * 
 * 
 * cdef class StringViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray *__pyx_vtabptr_7pyarrow_3lib_StringViewArray;


/* "pyarrow/lib.pxd":486
 * 
 * 
 * cdef class BinaryViewArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray *__pyx_vtabptr_7pyarrow_3lib_BinaryViewArray;


/* "pyarrow/lib.pxd":490
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _indices, _dictionary
*/

struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray *__pyx_vtabptr_7pyarrow_3lib_DictionaryArray;


/* "pyarrow/lib.pxd":495
 * 
 * 
 * cdef class ExtensionArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray *__pyx_vtabptr_7pyarrow_3lib_ExtensionArray;


/* "pyarrow/lib.pxd":499
 * 
 * 
 * cdef class MonthDayNanoIntervalArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray {
  struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray *__pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray;


/* "pyarrow/lib.pxd":507
 * 
 * 
 * cdef class ChunkedArray(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, std::shared_ptr< arrow::ChunkedArray>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtabptr_7pyarrow_3lib_ChunkedArray;


/* "pyarrow/lib.pxd":522
 * 
 * 
 * cdef class _Tabular(_PandasConvertible):             # <<<<<<<<<<<<<<
 *     cdef void _assert_cpu(self) except *
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib__Tabular {
  void (*_assert_cpu)(struct __pyx_obj_7pyarrow_3lib__Tabular *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib__Tabular *__pyx_vtabptr_7pyarrow_3lib__Tabular;


/* "pyarrow/lib.pxd":526
 * 
 * 
 * cdef class Table(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Table {
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular __pyx_base;
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Table *, std::shared_ptr< arrow::Table>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table *__pyx_vtabptr_7pyarrow_3lib_Table;


/* "pyarrow/lib.pxd":536
 * 
 * 
 * cdef class RecordBatch(_Tabular):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatch] sp_batch
*/

struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch {
  struct __pyx_vtabstruct_7pyarrow_3lib__Tabular __pyx_base;
  void (*init)(struct __pyx_obj_7pyarrow_3lib_RecordBatch *, std::shared_ptr< arrow::RecordBatch>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch *__pyx_vtabptr_7pyarrow_3lib_RecordBatch;


/* "pyarrow/lib.pxd":545
 * 
 * 
 * cdef class Device(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CDevice] device
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Device {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Device *, std::shared_ptr< arrow::Device>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::Device>  const &);
  std::shared_ptr< arrow::Device>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_Device *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Device *__pyx_vtabptr_7pyarrow_3lib_Device;


/* "pyarrow/lib.pxd":557
 * 
 * 
 * cdef class MemoryManager(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CMemoryManager] memory_manager
*/

struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_MemoryManager *, std::shared_ptr< arrow::MemoryManager>  const &);
  PyObject *(*wrap)(std::shared_ptr< arrow::MemoryManager>  const &);
  std::shared_ptr< arrow::MemoryManager>  (*unwrap)(struct __pyx_obj_7pyarrow_3lib_MemoryManager *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager *__pyx_vtabptr_7pyarrow_3lib_MemoryManager;


/* "pyarrow/lib.pxd":569
 * 
 * 
 * cdef class Buffer(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CBuffer] buffer
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Buffer {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Buffer *, std::shared_ptr< arrow::Buffer>  const &);
  PyObject *(*getitem)(struct __pyx_obj_7pyarrow_3lib_Buffer *, int64_t);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Buffer *__pyx_vtabptr_7pyarrow_3lib_Buffer;


/* "pyarrow/lib.pxd":579
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer)
*/

struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer {
  struct __pyx_vtabstruct_7pyarrow_3lib_Buffer __pyx_base;
  void (*init_rz)(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *, std::shared_ptr< arrow::ResizableBuffer>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer *__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer;


/* "pyarrow/lib.pxd":584
 * 
 * 
 * cdef class NativeFile(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CInputStream] input_stream
*/

struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile {
  PyObject *(*set_random_access_file)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::RandomAccessFile> );
  PyObject *(*set_input_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::InputStream> );
  PyObject *(*set_output_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr< arrow::io::OutputStream> );
  std::shared_ptr< arrow::io::RandomAccessFile>  (*get_random_access_file)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
  std::shared_ptr< arrow::io::InputStream>  (*get_input_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
  std::shared_ptr< arrow::io::OutputStream>  (*get_output_stream)(struct __pyx_obj_7pyarrow_3lib_NativeFile *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtabptr_7pyarrow_3lib_NativeFile;


/* "pyarrow/lib.pxd":608
 * 
 * 
 * cdef class BufferedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream *__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream;


/* "pyarrow/lib.pxd":612
 * 
 * 
 * cdef class BufferedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream *__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream;


/* "pyarrow/lib.pxd":616
 * 
 * 
 * cdef class CompressedInputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream *__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream;


/* "pyarrow/lib.pxd":620
 * 
 * 
 * cdef class CompressedOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
*/

struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream {
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream *__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream;


/* "pyarrow/lib.pxd":634
 * 
 * 
 * cdef class CacheOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCacheOptions wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_CacheOptions *, arrow::io::CacheOptions);
  arrow::io::CacheOptions (*unwrap)(struct __pyx_obj_7pyarrow_3lib_CacheOptions *);
  PyObject *(*wrap)(arrow::io::CacheOptions const );
};
static struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions *__pyx_vtabptr_7pyarrow_3lib_CacheOptions;


/* "pyarrow/lib.pxd":646
 * 
 * 
 * cdef class Codec(_Weakrefable):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CCodec] wrapped
*/

struct __pyx_vtabstruct_7pyarrow_3lib_Codec {
   arrow::util::Codec *(*unwrap)(struct __pyx_obj_7pyarrow_3lib_Codec *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Codec *__pyx_vtabptr_7pyarrow_3lib_Codec;


/* "pyarrow/lib.pxd":654
 * 
 * # This class is only used internally for now
 * cdef class StopToken:             # <<<<<<<<<<<<<<
 *     cdef:
 *         CStopToken stop_token
*/

struct __pyx_vtabstruct_7pyarrow_3lib_StopToken {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_StopToken *, arrow::StopToken);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StopToken *__pyx_vtabptr_7pyarrow_3lib_StopToken;


/* "pyarrow/_flight.pyx":100
 * 
 * 
 * cdef class FlightCallOptions(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """RPC-layer options for a Flight call."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCallOptions {
   arrow::flight::FlightCallOptions *(*unwrap)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCallOptions *__pyx_vtabptr_7pyarrow_7_flight_FlightCallOptions;


/* "pyarrow/_flight.pyx":184
 * 
 * 
 * cdef class FlightError(Exception):             # <<<<<<<<<<<<<<
 *     """
 *     The base class for Flight-specific errors.
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError {
  arrow::Status (*to_status)(struct __pyx_obj_7pyarrow_7_flight_FlightError *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *__pyx_vtabptr_7pyarrow_7_flight_FlightError;


/* "pyarrow/_flight.pyx":217
 * 
 * 
 * cdef class FlightInternalError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """An error internal to the Flight server occurred."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightInternalError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightInternalError *__pyx_vtabptr_7pyarrow_7_flight_FlightInternalError;


/* "pyarrow/_flight.pyx":225
 * 
 * 
 * cdef class FlightTimedOutError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The Flight RPC call timed out."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightTimedOutError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightTimedOutError *__pyx_vtabptr_7pyarrow_7_flight_FlightTimedOutError;


/* "pyarrow/_flight.pyx":233
 * 
 * 
 * cdef class FlightCancelledError(FlightError, ArrowCancelled):             # <<<<<<<<<<<<<<
 *     """The operation was cancelled."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCancelledError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCancelledError *__pyx_vtabptr_7pyarrow_7_flight_FlightCancelledError;


/* "pyarrow/_flight.pyx":241
 * 
 * 
 * cdef class FlightServerError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """A server error occurred."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerError *__pyx_vtabptr_7pyarrow_7_flight_FlightServerError;


/* "pyarrow/_flight.pyx":249
 * 
 * 
 * cdef class FlightUnauthenticatedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authenticated."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnauthenticatedError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_vtabptr_7pyarrow_7_flight_FlightUnauthenticatedError;


/* "pyarrow/_flight.pyx":257
 * 
 * 
 * cdef class FlightUnauthorizedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authorized to perform the given operation."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnauthorizedError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_vtabptr_7pyarrow_7_flight_FlightUnauthorizedError;


/* "pyarrow/_flight.pyx":265
 * 
 * 
 * cdef class FlightUnavailableError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The server is not reachable or available."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnavailableError {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightUnavailableError *__pyx_vtabptr_7pyarrow_7_flight_FlightUnavailableError;


/* "pyarrow/_flight.pyx":282
 * 
 * 
 * cdef class Action(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """An action executable on a Flight service."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_Action {
   arrow::flight::Action (*unwrap)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_Action *__pyx_vtabptr_7pyarrow_7_flight_Action;


/* "pyarrow/_flight.pyx":517
 * 
 * 
 * cdef class FlightDescriptor(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A description of a data stream available from a Flight service."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDescriptor {
   arrow::flight::FlightDescriptor (*unwrap)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDescriptor *__pyx_vtabptr_7pyarrow_7_flight_FlightDescriptor;


/* "pyarrow/_flight.pyx":654
 * 
 * 
 * cdef class Location(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """The location of a Flight service."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_Location {
  struct __pyx_obj_7pyarrow_7_flight_Location *(*wrap)( arrow::flight::Location);
   arrow::flight::Location (*unwrap)(PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_Location *__pyx_vtabptr_7pyarrow_7_flight_Location;


/* "pyarrow/_flight.pyx":907
 * 
 * 
 * cdef class FlightInfo(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A description of a Flight stream."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightInfo {
  PyObject *(*wrap)( arrow::flight::FlightInfo);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightInfo *__pyx_vtabptr_7pyarrow_7_flight_FlightInfo;


/* "pyarrow/_flight.pyx":1197
 * 
 * 
 * cdef class MetadataRecordBatchWriter(_CRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     """A RecordBatchWriter that also allows writing application metadata.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter {
   arrow::flight::MetadataRecordBatchWriter *(*_writer)(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_vtabptr_7pyarrow_7_flight_MetadataRecordBatchWriter;


/* "pyarrow/_flight.pyx":1295
 * 
 * 
 * cdef class FlightStreamWriter(MetadataRecordBatchWriter):             # <<<<<<<<<<<<<<
 *     """A writer that also allows closing the write side of a stream."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightStreamWriter {
  struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightStreamWriter *__pyx_vtabptr_7pyarrow_7_flight_FlightStreamWriter;


/* "pyarrow/_flight.pyx":1362
 * 
 * 
 * cdef class AsyncioFlightClient:             # <<<<<<<<<<<<<<
 *     """
 *     A FlightClient with an asyncio-based async interface.
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_AsyncioFlightClient {
  PyObject *(*_get_flight_info)(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *, PyObject *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_AsyncioFlightClient *__pyx_vtabptr_7pyarrow_7_flight_AsyncioFlightClient;


/* "pyarrow/_flight.pyx":1400
 * 
 * 
 * cdef class FlightClient(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A client to a Flight service.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightClient {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_7_flight_FlightClient *, struct __pyx_obj_7pyarrow_7_flight_Location *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightClient *__pyx_vtabptr_7pyarrow_7_flight_FlightClient;


/* "pyarrow/_flight.pyx":1829
 * 
 * 
 * cdef class FlightDataStream(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """
 *     Abstract base class for Flight data streams.
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream {
   arrow::flight::FlightDataStream *(*to_stream)(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream *__pyx_vtabptr_7pyarrow_7_flight_FlightDataStream;


/* "pyarrow/_flight.pyx":1848
 * 
 * 
 * cdef class RecordBatchStream(FlightDataStream):             # <<<<<<<<<<<<<<
 *     """A Flight data stream backed by RecordBatches.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_RecordBatchStream {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_RecordBatchStream *__pyx_vtabptr_7pyarrow_7_flight_RecordBatchStream;


/* "pyarrow/_flight.pyx":1890
 * 
 * 
 * cdef class GeneratorStream(FlightDataStream):             # <<<<<<<<<<<<<<
 *     """A Flight data stream backed by a Python generator."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_GeneratorStream {
  struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_GeneratorStream *__pyx_vtabptr_7pyarrow_7_flight_GeneratorStream;


/* "pyarrow/_flight.pyx":1925
 * 
 * 
 * cdef class ServerCallContext(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Per-call state/context."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ServerCallContext {
  struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *(*wrap)( arrow::flight::ServerCallContext const &);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ServerCallContext *__pyx_vtabptr_7pyarrow_7_flight_ServerCallContext;


/* "pyarrow/_flight.pyx":1989
 * 
 * 
 * cdef class ServerAuthReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A reader for messages from the client during an auth handshake."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader {
  void (*poison)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *);
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *(*wrap)( arrow::flight::ServerAuthReader *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader *__pyx_vtabptr_7pyarrow_7_flight_ServerAuthReader;


/* "pyarrow/_flight.pyx":2020
 * 
 * 
 * cdef class ServerAuthSender(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A writer for messages to the client during an auth handshake."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender {
  void (*poison)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *);
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *(*wrap)( arrow::flight::ServerAuthSender *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender *__pyx_vtabptr_7pyarrow_7_flight_ServerAuthSender;


/* "pyarrow/_flight.pyx":2050
 * 
 * 
 * cdef class ClientAuthReader(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A reader for messages from the server during an auth handshake."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader {
  void (*poison)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *);
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *(*wrap)( arrow::flight::ClientAuthReader *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader *__pyx_vtabptr_7pyarrow_7_flight_ClientAuthReader;


/* "pyarrow/_flight.pyx":2081
 * 
 * 
 * cdef class ClientAuthSender(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A writer for messages to the server during an auth handshake."""
 *     cdef:
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender {
  void (*poison)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *);
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *(*wrap)( arrow::flight::ClientAuthSender *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender *__pyx_vtabptr_7pyarrow_7_flight_ClientAuthSender;


/* "pyarrow/_flight.pyx":2545
 * 
 * 
 * cdef class ServerAuthHandler(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Authentication middleware for a server.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthHandler {
   arrow::py::flight::PyServerAuthHandler *(*to_handler)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthHandler *__pyx_vtabptr_7pyarrow_7_flight_ServerAuthHandler;


/* "pyarrow/_flight.pyx":2589
 * 
 * 
 * cdef class ClientAuthHandler(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Authentication plugin for a client."""
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthHandler {
   arrow::py::flight::PyClientAuthHandler *(*to_handler)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthHandler *__pyx_vtabptr_7pyarrow_7_flight_ClientAuthHandler;


/* "pyarrow/_flight.pyx":2655
 * 
 * 
 * cdef class ClientMiddleware(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Client-side middleware for a call, instantiated per RPC.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ClientMiddleware {
  void (*wrap)(PyObject *, std::unique_ptr< arrow::flight::ClientMiddleware>  *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ClientMiddleware *__pyx_vtabptr_7pyarrow_7_flight_ClientMiddleware;


/* "pyarrow/_flight.pyx":2772
 * 
 * 
 * cdef class ServerMiddleware(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """Server-side middleware for a call, instantiated per RPC.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_ServerMiddleware {
  void (*wrap)(PyObject *, std::shared_ptr< arrow::flight::ServerMiddleware>  *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_ServerMiddleware *__pyx_vtabptr_7pyarrow_7_flight_ServerMiddleware;


/* "pyarrow/_flight.pyx":2846
 * 
 * 
 * cdef class _ServerMiddlewareWrapper(ServerMiddleware):             # <<<<<<<<<<<<<<
 *     cdef:
 *         dict middleware
*/

struct __pyx_vtabstruct_7pyarrow_7_flight__ServerMiddlewareWrapper {
  struct __pyx_vtabstruct_7pyarrow_7_flight_ServerMiddleware __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_vtabptr_7pyarrow_7_flight__ServerMiddlewareWrapper;


/* "pyarrow/_flight.pyx":2901
 * 
 * 
 * cdef class FlightServerBase(_Weakrefable):             # <<<<<<<<<<<<<<
 *     """A Flight service definition.
 * 
*/

struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerBase {
  PyObject *(*init)(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *, struct __pyx_obj_7pyarrow_7_flight_Location *, struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *, PyObject *, bool, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerBase *__pyx_vtabptr_7pyarrow_7_flight_FlightServerBase;
/* #### 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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyErrFetchRestore) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

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

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

/* PyDictVersioning.proto (used by GetModuleGlobalName) */
#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_XNewRef(__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

/* PyObjectCall.proto (used by PyObjectFastCall) */
#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 (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto (used by PyObjectVectorCallKwBuilder) */
#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);

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

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

/* TupleAndListFromArray.proto (used by fastcall) */
#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

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

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

/* UnicodeEquals.proto (used by fastcall) */
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

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#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)

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

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
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

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

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

/* ParseKeywordsImpl.export */
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
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
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
);

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

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

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

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

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

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

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

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

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

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

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

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#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

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

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

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

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

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

/* PyRuntimeError_Check.proto */
#define __Pyx_PyExc_RuntimeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_RuntimeError)

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

/* CBIntToPyUnicode.proto */
#define __Pyx_PyUnicode_FromBInt_bool(value)\
    ((value) ? __Pyx_NewRef(__pyx_mstate_global->__pyx_n_u_True) : __Pyx_NewRef(__pyx_mstate_global->__pyx_n_u_False))

/* PyStopIteration_Check.proto */
#define __Pyx_PyExc_StopIteration_Check(obj)  __Pyx_TypeCheck(obj, PyExc_StopIteration)

/* tp_new.proto */
#define __Pyx_tp_new(type_obj, args) __Pyx_tp_new_kwargs(type_obj, args, NULL)
static CYTHON_INLINE PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs);

/* ErrOccurredWithGIL.proto */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void);

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

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

/* GetTopmostException.proto (used by SaveResetException) */
#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

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

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

/* PyFutureWarning_Check.proto */
#define __Pyx_PyExc_FutureWarning_Check(obj)  __Pyx_TypeCheck(obj, PyExc_FutureWarning)

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

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

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

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

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

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

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

/* CommonTypesMetaclass.proto (used by CoroutineBase) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* SwapException.proto (used by CoroutineBase) */
#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

/* CallTypeTraverse.proto (used by CoroutineBase) */
#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

/* IterNextPlain.proto (used by CoroutineBase) */
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
#endif

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

/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

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

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

/* ReturnWithStopIteration.proto (used by CoroutineBase) */
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);

/* CoroutineBase.proto (used by Coroutine) */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *gi_weakreflist;
#endif
    PyObject *classobj;
    PyObject *yieldfrom;
    __Pyx_pyiter_sendfunc yieldfrom_am_send;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
    PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
    uint64_t __pyx_pymonitoring_version;
#endif
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);

/* Coroutine.proto (used by CoroutineYieldFrom) */
#define __Pyx_Coroutine_USED
#define __Pyx_Coroutine_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineType)
#define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj)
#define __Pyx_CoroutineAwait_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CoroutineAwaitType)
#define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_CoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_Coroutine_init(PyObject *module);
static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
typedef struct {
    PyObject_HEAD
    PyObject *coroutine;
} __pyx_CoroutineAwaitObject;
static __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self);

/* Coro_CheckExact.proto (used by GetAwaitIter) */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyCoro_CheckExact(PyObject *o);
#else
#define __Pyx_PyCoro_CheckExact PyCoro_CheckExact
#endif

/* GetAwaitIter.proto (used by CoroutineYieldFrom) */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o);
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o);

/* CoroutineYieldFrom.proto */
static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval);

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

/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_NotImplementedError)

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

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

/* CythonFunctionShared.proto (used by CythonFunction) */
#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_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    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_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);

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

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

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

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

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

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

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

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

/* UnpackTuple2.proto (used by dict_iter) */
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);

/* IncludeCppStringH.proto (used by decode_cpp_string) */
#include <string>

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

/* decode_c_bytes.proto (used by decode_cpp_string) */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_cpp_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
         std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    return __Pyx_decode_c_bytes(
        cppstring.data(), (Py_ssize_t) cppstring.size(), start, stop, encoding, errors, decode_func);
}

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

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

/* CallNextTpDealloc.proto */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear);

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_4
#define __PYX_HAVE_RT_ImportType_proto_3_2_4
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_4(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_4 {
   __Pyx_ImportType_CheckSize_Error_3_2_4 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_4 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_4 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size);
#endif

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#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 (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type);

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

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

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

/* FormatTypeName.proto (used by ValidateExternBase) */
#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

/* ValidateExternBase.proto */
static int __Pyx_validate_extern_base(PyTypeObject *base);

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_2_4(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

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

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

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

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

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

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

/* CyFunctionClassCell.proto */
static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj);

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

/* CLineInTraceback.proto (used by AddTraceback) */
#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 (used by AddTraceback) */
#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);

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#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

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

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

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

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

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

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

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

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* 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 */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);
static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);

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

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

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

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
#endif
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/
static  arrow::flight::FlightCallOptions *__pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(PyObject *__pyx_v_obj); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_11FlightError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_19FlightInternalError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_19FlightTimedOutError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_20FlightCancelledError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_17FlightServerError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_26FlightUnauthenticatedError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_23FlightUnauthorizedError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self); /* proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight_22FlightUnavailableError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self); /* proto*/
static  arrow::flight::Action __pyx_f_7pyarrow_7_flight_6Action_unwrap(PyObject *__pyx_v_action); /* proto*/
static  arrow::flight::FlightDescriptor __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(PyObject *__pyx_v_descriptor); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_f_7pyarrow_7_flight_8Location_wrap( arrow::flight::Location __pyx_v_location); /* proto*/
static  arrow::flight::Location __pyx_f_7pyarrow_7_flight_8Location_unwrap(PyObject *__pyx_v_location); /* proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_10FlightInfo_wrap( arrow::flight::FlightInfo __pyx_v_c_info); /* proto*/
static  arrow::flight::MetadataRecordBatchWriter *__pyx_f_7pyarrow_7_flight_25MetadataRecordBatchWriter__writer(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_19AsyncioFlightClient__get_flight_info(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, PyObject *__pyx_v_call, PyObject *__pyx_v_descriptor, PyObject *__pyx_v_options); /* proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_12FlightClient_init(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_middleware, PyObject *__pyx_v_write_size_limit_bytes, PyObject *__pyx_v_disable_server_verification, PyObject *__pyx_v_generic_options); /* proto*/
static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_16FlightDataStream_to_stream(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self); /* proto*/
static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_17RecordBatchStream_to_stream(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self); /* proto*/
static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_15GeneratorStream_to_stream(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap( arrow::flight::ServerCallContext const &__pyx_v_context); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ServerAuthReader_poison(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_f_7pyarrow_7_flight_16ServerAuthReader_wrap( arrow::flight::ServerAuthReader *__pyx_v_reader); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ServerAuthSender_poison(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_f_7pyarrow_7_flight_16ServerAuthSender_wrap( arrow::flight::ServerAuthSender *__pyx_v_sender); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ClientAuthReader_poison(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_f_7pyarrow_7_flight_16ClientAuthReader_wrap( arrow::flight::ClientAuthReader *__pyx_v_reader); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ClientAuthSender_poison(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self); /* proto*/
static struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_f_7pyarrow_7_flight_16ClientAuthSender_wrap( arrow::flight::ClientAuthSender *__pyx_v_sender); /* proto*/
static  arrow::py::flight::PyServerAuthHandler *__pyx_f_7pyarrow_7_flight_17ServerAuthHandler_to_handler(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self); /* proto*/
static  arrow::py::flight::PyClientAuthHandler *__pyx_f_7pyarrow_7_flight_17ClientAuthHandler_to_handler(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ClientMiddleware_wrap(PyObject *__pyx_v_py_middleware, std::unique_ptr< arrow::flight::ClientMiddleware>  *__pyx_v_c_instance); /* proto*/
static void __pyx_f_7pyarrow_7_flight_16ServerMiddleware_wrap(PyObject *__pyx_v_py_middleware, std::shared_ptr< arrow::flight::ServerMiddleware>  *__pyx_v_c_instance); /* proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_16FlightServerBase_init(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_location, struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_auth_handler, PyObject *__pyx_v_tls_certificates, bool __pyx_v_verify_client, PyObject *__pyx_v_root_certificates, PyObject *__pyx_v_middleware); /* proto*/

/* Module declarations from "libcpp" */

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

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "__builtin__" */

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

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

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

/* Module declarations from "cython" */

/* Module declarations from "__builtin__" */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "cpython" */

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from "datetime" */

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

/* Module declarations from "pyarrow.includes.common" */

/* Module declarations from "pyarrow.includes.libarrow" */

/* Module declarations from "pyarrow.includes.libarrow_python" */

/* Module declarations from "pyarrow.lib" */
static int (*__pyx_f_7pyarrow_3lib_check_status)(arrow::Status const &); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *(*__pyx_f_7pyarrow_3lib_wrap_ipc_write_options)( arrow::ipc::IpcWriteOptions); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *(*__pyx_f_7pyarrow_3lib_wrap_ipc_read_options)( arrow::ipc::IpcReadOptions); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib__wrap_read_stats)( arrow::ipc::ReadStats); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer)(std::shared_ptr< arrow::Buffer>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_resizable_buffer)(std::shared_ptr< arrow::ResizableBuffer>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type)(std::shared_ptr< arrow::DataType>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_field)(std::shared_ptr< arrow::Field>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema)(std::shared_ptr< arrow::Schema>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_scalar)(std::shared_ptr< arrow::Scalar>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_array)(std::shared_ptr< arrow::Array>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_chunked_array)(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_coo_tensor)(std::shared_ptr< arrow::SparseCOOTensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csc_matrix)(std::shared_ptr< arrow::SparseCSCMatrix>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csf_tensor)(std::shared_ptr< arrow::SparseCSFTensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_sparse_csr_matrix)(std::shared_ptr< arrow::SparseCSRMatrix>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor)(std::shared_ptr< arrow::Tensor>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch)(std::shared_ptr< arrow::RecordBatch>  const &); /*proto*/
static PyObject *(*__pyx_f_7pyarrow_3lib_pyarrow_wrap_table)(std::shared_ptr< arrow::Table>  const &); /*proto*/
static std::shared_ptr< arrow::Buffer>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer)(PyObject *); /*proto*/
static std::shared_ptr< arrow::DataType>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_data_type)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Field>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_field)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Schema>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Scalar>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_scalar)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Array>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_array)(PyObject *); /*proto*/
static std::shared_ptr< arrow::ChunkedArray>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_chunked_array)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCOOTensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_coo_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSCMatrix>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csc_matrix)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSFTensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csf_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::SparseCSRMatrix>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_sparse_csr_matrix)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Tensor>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_tensor)(PyObject *); /*proto*/
static std::shared_ptr< arrow::RecordBatch>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_batch)(PyObject *); /*proto*/
static std::shared_ptr< arrow::Table>  (*__pyx_f_7pyarrow_3lib_pyarrow_unwrap_table)(PyObject *); /*proto*/

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

/* Module declarations from "pyarrow.includes.libarrow_flight" */

/* Module declarations from "pyarrow._flight" */
static  arrow::flight::FlightCallOptions __pyx_v_7pyarrow_7_flight_DEFAULT_CALL_OPTIONS;
static int __pyx_f_7pyarrow_7_flight_check_flight_status(arrow::Status const &); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_f_7pyarrow_7_flight__get_options(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_wrap_flight_method( arrow::flight::FlightMethod); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__data_stream_next(void *,  arrow::flight::FlightPayload *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__list_flights(void *,  arrow::flight::ServerCallContext const &,  arrow::flight::Criteria const *, std::unique_ptr< arrow::flight::FlightListing>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__get_flight_info(void *,  arrow::flight::ServerCallContext const &,  arrow::flight::FlightDescriptor, std::unique_ptr< arrow::flight::FlightInfo>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__get_schema(void *,  arrow::flight::ServerCallContext const &,  arrow::flight::FlightDescriptor, std::unique_ptr< arrow::flight::SchemaResult>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__do_put(void *,  arrow::flight::ServerCallContext const &, std::unique_ptr< arrow::flight::FlightMessageReader> , std::unique_ptr< arrow::flight::FlightMetadataWriter> ); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__do_get(void *,  arrow::flight::ServerCallContext const &,  arrow::flight::Ticket, std::unique_ptr< arrow::flight::FlightDataStream>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__do_exchange(void *,  arrow::flight::ServerCallContext const &, std::unique_ptr< arrow::flight::FlightMessageReader> , std::unique_ptr< arrow::flight::FlightMessageWriter> ); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__do_action_result_next(void *, std::unique_ptr< arrow::flight::Result>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__do_action(void *,  arrow::flight::ServerCallContext const &,  arrow::flight::Action const &, std::unique_ptr< arrow::flight::ResultStream>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__list_actions(void *,  arrow::flight::ServerCallContext const &, std::vector< arrow::flight::ActionType>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__server_authenticate(void *,  arrow::flight::ServerAuthSender *,  arrow::flight::ServerAuthReader *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__is_valid(void *, std::string const &, std::string *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__client_authenticate(void *,  arrow::flight::ClientAuthSender *,  arrow::flight::ClientAuthReader *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__get_token(void *, std::string *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_sending_headers(void *,  arrow::flight::AddCallHeaders *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_call_completed(void *, arrow::Status const &); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_received_headers(void *,  arrow::flight::CallHeaders const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_convert_headers( arrow::flight::CallHeaders const &); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__server_middleware_start_call(void *,  arrow::flight::CallInfo const &,  arrow::flight::CallHeaders const &, std::shared_ptr< arrow::flight::ServerMiddleware>  *); /*proto*/
static arrow::Status __pyx_f_7pyarrow_7_flight__client_middleware_start_call(void *,  arrow::flight::CallInfo const &, std::unique_ptr< arrow::flight::ClientMiddleware>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight_wrap_call_info( arrow::flight::CallInfo const &); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightInternalError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightTimedOutError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightCancelledError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightServerError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthenticatedError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthorizedError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnavailableError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_AsyncioFlightClient__set_state(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightDataStream__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerAuthHandler__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientAuthHandler__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddleware__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_TracingServerMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddleware__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *, PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareWrapper__set_state(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *, 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::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
static std::pair<std::string,std::string>  __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
static PyObject *__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(std::pair<std::string,std::string>  const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(std::vector<std::pair<std::string,std::string> >  const &); /*proto*/
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(std::vector<std::string>  const &); /*proto*/
static std::vector<std::pair<std::string,std::string> >  __pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(PyObject *); /*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 "pyarrow._flight"
extern int __pyx_module_is_main_pyarrow___flight;
int __pyx_module_is_main_pyarrow___flight = 0;

/* Implementation of "pyarrow._flight" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_NotImplemented;
/* #### Code section: string_decls ### */
static const char __pyx_k__5[] = "";
static const char __pyx_k_client_2[] = "_client";
static const char __pyx_k_factories[] = "factories";
static const char __pyx_k_middleware[] = "middleware";
/* #### Code section: decls ### */
static PyObject *__pyx_pf_7pyarrow_7_flight__munge_grpc_python_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */
static int __pyx_pf_7pyarrow_7_flight_17FlightCallOptions___init__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self, PyObject *__pyx_v_timeout, PyObject *__pyx_v_write_options, PyObject *__pyx_v_headers, struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *__pyx_v_read_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_7timeout___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_7headers___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_12read_options___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_13write_options___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_2__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_11FlightError___init__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_extra_info); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_11FlightError_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_11FlightError_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightInternalError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightServerError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_28FlightWriteSizeExceededError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_limit, PyObject *__pyx_v_actual); /* proto */
static int __pyx_pf_7pyarrow_7_flight_6Action___init__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self, PyObject *__pyx_v_action_type, PyObject *__pyx_v_buf); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_4type___get__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_4body___get__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_2serialize(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10ActionType_make_action(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */
static int __pyx_pf_7pyarrow_7_flight_6Result___init__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_4body___get__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_2serialize(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_9BasicAuth___init__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8username___get__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8password___get__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_2deserialize(PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_4serialize(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_6__eq__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8__repr__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_16FlightDescriptor___init__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_2for_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_4for_command(PyObject *__pyx_v_command); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_7command___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_4path___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_6__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_8serialize(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_10deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_12__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_6Ticket___init__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self, PyObject *__pyx_v_ticket); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_6ticket___get__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_2serialize(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_8Location___init__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, PyObject *__pyx_v_uri); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_2__repr__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_3uri___get__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_4equals(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_8for_grpc_tcp(PyObject *__pyx_v_host, PyObject *__pyx_v_port); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_10for_grpc_tls(PyObject *__pyx_v_host, PyObject *__pyx_v_port); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_12for_grpc_unix(PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_14FlightEndpoint___init__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self, PyObject *__pyx_v_ticket, PyObject *__pyx_v_locations, PyObject *__pyx_v_expiration_time, PyObject *__pyx_v_app_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_6ticket___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_9locations___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_15expiration_time___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_2serialize(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_6__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_8__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_12SchemaResult___init__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_6schema___get__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_2serialize(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_6__eq__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_8__repr__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_10FlightInfo___init__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, PyObject *__pyx_v_endpoints, PyObject *__pyx_v_total_records, PyObject *__pyx_v_total_bytes, PyObject *__pyx_v_ordered, PyObject *__pyx_v_app_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_13total_records___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_11total_bytes___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_7ordered___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_6schema___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_10descriptor___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_9endpoints___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_2serialize(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_6__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_8__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_4data___get__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk___iter__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_2__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader___iter__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_2__next__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema___get__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats___get__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_cancel(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_2read_all(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_buf); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch, PyObject *__pyx_v_buf); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_done_writing(struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_read(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_write(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_11AsyncioCall___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_11AsyncioCall_2as_awaitable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_11AsyncioCall_4wakeup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_result_or_exception); /* proto */
static int __pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient___init__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_client); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_12FlightClient___init__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_middleware, PyObject *__pyx_v_write_size_limit_bytes, PyObject *__pyx_v_disable_server_verification, PyObject *__pyx_v_generic_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_14supports_async___get__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_2as_async(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_4wait_for_available(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_disable_server_verification); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_8authenticate(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_auth_handler, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_12list_actions(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_9do_action__do_action_response(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_14do_action(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_action, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_16list_flights(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_criteria, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_19get_flight_info(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_21get_schema(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_23do_get(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_ticket, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_25do_put(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_27do_exchange(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_29close(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_7_flight_12FlightClient_31__del__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_33__enter__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_35__exit__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_37__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_39__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDataStream___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_17RecordBatchStream___init__(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self, PyObject *__pyx_v_data_source, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_15GeneratorStream___init__(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self, PyObject *__pyx_v_schema, PyObject *__pyx_v_generator, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_peer_identity(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_2peer(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_4is_cancelled(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_6add_header(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_8add_trailer(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_10get_middleware(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthReader_read(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthSender_write(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthReader_read(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthSender_write(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_authenticate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_outgoing, CYTHON_UNUSED PyObject *__pyx_v_incoming); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_2is_valid(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_token); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_authenticate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_outgoing, CYTHON_UNUSED PyObject *__pyx_v_incoming); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_2get_token(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_info); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_sending_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_2received_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_headers); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_4call_completed(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_info, CYTHON_UNUSED PyObject *__pyx_v_headers); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_sending_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_2call_completed(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_23TracingServerMiddleware___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_trace_context); /* proto */
static int __pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper___init__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v_factories); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v_info, PyObject *__pyx_v_headers); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper___init__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v_middleware); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v_exception); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_finalize(struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_7_flight_16FlightServerBase___init__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, PyObject *__pyx_v_location, PyObject *__pyx_v_auth_handler, PyObject *__pyx_v_tls_certificates, PyObject *__pyx_v_verify_client, PyObject *__pyx_v_root_certificates, PyObject *__pyx_v_middleware); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_4port___get__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_2list_flights(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_criteria); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_4get_flight_info(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_6get_schema(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_8do_put(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor, CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_reader, CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_writer); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_10do_get(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_ticket); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_12do_exchange(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor, CYTHON_UNUSED PyObject *__pyx_v_reader, CYTHON_UNUSED PyObject *__pyx_v_writer); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_14list_actions(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_16do_action(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_action); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_18serve(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_20run(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_22shutdown(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_24wait(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_26__enter__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_28__exit__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_2connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_location, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_4__pyx_unpickle_FlightError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_6__pyx_unpickle_FlightInternalError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_8__pyx_unpickle_FlightTimedOutError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_10__pyx_unpickle_FlightCancelledError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_12__pyx_unpickle_FlightServerError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_14__pyx_unpickle_FlightUnauthenticatedError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_16__pyx_unpickle_FlightUnauthorizedError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_18__pyx_unpickle_FlightUnavailableError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_20__pyx_unpickle_AsyncioFlightClient(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_22__pyx_unpickle_FlightDataStream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_24__pyx_unpickle_ServerAuthHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_26__pyx_unpickle_ClientAuthHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_28__pyx_unpickle_ClientMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_30__pyx_unpickle_ClientMiddleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_32__pyx_unpickle_ServerMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_34__pyx_unpickle_TracingServerMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_36__pyx_unpickle_ServerMiddleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_38__pyx_unpickle__ServerMiddlewareFactoryWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_7pyarrow_7_flight_40__pyx_unpickle__ServerMiddlewareWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightCallOptions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightInternalError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightTimedOutError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightCancelledError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightServerError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnauthenticatedError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnauthorizedError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnavailableError(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_Action(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_Result(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_BasicAuth(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_Ticket(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_Location(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightEndpoint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_SchemaResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightStreamChunk(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_MetadataRecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightMetadataReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightMetadataWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_AsyncioFlightClient(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightClient(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightDataStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_RecordBatchStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_GeneratorStream(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerCallContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthSender(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthSender(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientMiddlewareFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientMiddleware(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerMiddlewareFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerMiddleware(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight__FlightServerFinalizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightServerBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct__get_flight_info(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_1_do_action(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_3_list_flights(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;
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_date;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_time;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Weakrefable;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IpcWriteOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IpcReadOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Message;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryPool;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DataType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListViewType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListViewType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryMemo;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_TimestampType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time32Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Time64Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DurationType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal32Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal64Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal256Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RunEndEncodedType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseExtensionType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Bool8Type;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_OpaqueType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UuidType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_JsonType;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Metadata;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_KeyValueMetadata;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Field;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Schema;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Scalar;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ArrayStatistics;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__PandasConvertible;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCOOTensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_SparseCSFTensor;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NullArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BooleanArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NumericArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_IntegerArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatingPointArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int8Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt8Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int16Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt16Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UInt64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_HalfFloatArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FloatArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DoubleArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal32Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal64Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal256Array;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BaseListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_LargeListViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MapArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_FixedSizeListArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StringViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BinaryViewArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ExtensionArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ChunkedArray;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__Tabular;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Table;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatch;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Device;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_MemoryManager;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Buffer;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_ResizableBuffer;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_NativeFile;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedInputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_BufferedOutputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedInputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CompressedOutputStream;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_RecordBatchReader;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_CacheOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_Codec;
  PyTypeObject *__pyx_ptype_7pyarrow_3lib_StopToken;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightCallOptions;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightInternalError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightTimedOutError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightCancelledError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightServerError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightUnavailableError;
  PyObject *__pyx_type_7pyarrow_7_flight_Action;
  PyObject *__pyx_type_7pyarrow_7_flight_Result;
  PyObject *__pyx_type_7pyarrow_7_flight_BasicAuth;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightDescriptor;
  PyObject *__pyx_type_7pyarrow_7_flight_Ticket;
  PyObject *__pyx_type_7pyarrow_7_flight_Location;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightEndpoint;
  PyObject *__pyx_type_7pyarrow_7_flight_SchemaResult;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightInfo;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightStreamChunk;
  PyObject *__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader;
  PyObject *__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightStreamReader;
  PyObject *__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightStreamWriter;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightMetadataReader;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightMetadataWriter;
  PyObject *__pyx_type_7pyarrow_7_flight_AsyncioFlightClient;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightClient;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightDataStream;
  PyObject *__pyx_type_7pyarrow_7_flight_RecordBatchStream;
  PyObject *__pyx_type_7pyarrow_7_flight_GeneratorStream;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerCallContext;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerAuthReader;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerAuthSender;
  PyObject *__pyx_type_7pyarrow_7_flight_ClientAuthReader;
  PyObject *__pyx_type_7pyarrow_7_flight_ClientAuthSender;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerAuthHandler;
  PyObject *__pyx_type_7pyarrow_7_flight_ClientAuthHandler;
  PyObject *__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory;
  PyObject *__pyx_type_7pyarrow_7_flight_ClientMiddleware;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory;
  PyObject *__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory;
  PyObject *__pyx_type_7pyarrow_7_flight_ServerMiddleware;
  PyObject *__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper;
  PyObject *__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper;
  PyObject *__pyx_type_7pyarrow_7_flight__FlightServerFinalizer;
  PyObject *__pyx_type_7pyarrow_7_flight_FlightServerBase;
  PyObject *__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info;
  PyObject *__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action;
  PyObject *__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response;
  PyObject *__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightCallOptions;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightInternalError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightCancelledError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightServerError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_Action;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_Result;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_BasicAuth;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightDescriptor;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_Ticket;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_Location;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightEndpoint;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_SchemaResult;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightInfo;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightStreamReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightClient;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightDataStream;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_RecordBatchStream;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_GeneratorStream;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerCallContext;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerAuthReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerAuthSender;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ClientAuthReader;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ClientAuthSender;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ClientMiddleware;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_ServerMiddleware;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight_FlightServerBase;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response;
  PyTypeObject *__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  PyObject *__pyx_tuple[9];
  PyObject *__pyx_codeobj_tab[214];
  PyObject *__pyx_string_tab[815];
  PyObject *__pyx_number_tab[15];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* IterNextPlain.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
#endif

/* Coroutine.module_state_decls */
PyTypeObject *__pyx_CoroutineType;
PyTypeObject *__pyx_CoroutineAwaitType;

/* Coro_CheckExact.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedCoroType;
#endif

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct__get_flight_info[8];
int __pyx_freecount_7pyarrow_7_flight___pyx_scope_struct__get_flight_info;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_1_do_action[8];
int __pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_1_do_action;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response[8];
int __pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_3_list_flights[8];
int __pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_3_list_flights;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* Generator.module_state_decls */
PyTypeObject *__pyx_GeneratorType;

/* #### 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_kp_u_A_TLS_certificate_and_key_for_us __pyx_string_tab[1]
#define __pyx_kp_u_A_type_of_action_that_is_executa __pyx_string_tab[2]
#define __pyx_kp_u_A_write_operation_exceeded_the_c __pyx_string_tab[3]
#define __pyx_kp_u_Action_must_be_Action_instance_s __pyx_string_tab[4]
#define __pyx_kp_u_Argument_app_metadata_must_be_a __pyx_string_tab[5]
#define __pyx_kp_u_Argument_expiration_time_must_be __pyx_string_tab[6]
#define __pyx_kp_u_Argument_locations_must_contain __pyx_string_tab[7]
#define __pyx_kp_u_Argument_ticket_must_be_a_Ticket __pyx_string_tab[8]
#define __pyx_kp_u_Can_only_provide_TracingServerMi __pyx_string_tab[9]
#define __pyx_kp_u_Can_only_return_metadata_alongsi __pyx_string_tab[10]
#define __pyx_kp_u_Can_t_construct_RecordBatchStrea __pyx_string_tab[11]
#define __pyx_kp_u_Cannot_use_ClientAuthReader_outs __pyx_string_tab[12]
#define __pyx_kp_u_Cannot_use_ClientAuthSender_outs __pyx_string_tab[13]
#define __pyx_kp_u_Cannot_use_ServerAuthReader_outs __pyx_string_tab[14]
#define __pyx_kp_u_Cannot_use_ServerAuthSender_outs __pyx_string_tab[15]
#define __pyx_kp_u_Do_not_call __pyx_string_tab[16]
#define __pyx_kp_u_Endpoint __pyx_string_tab[17]
#define __pyx_kp_u_Expected __pyx_string_tab[18]
#define __pyx_kp_u_Expected_RecordBatchReader_or_Ta __pyx_string_tab[19]
#define __pyx_kp_u_Expected_a_FlightCallOptions_obj __pyx_string_tab[20]
#define __pyx_kp_u_FlightClient_authenticate_takes __pyx_string_tab[21]
#define __pyx_kp_u_FlightServerBase_do_get_must_ret __pyx_string_tab[22]
#define __pyx_kp_u_FlightServerBase_get_flight_info __pyx_string_tab[23]
#define __pyx_kp_u_FlightServerBase_get_schema_info __pyx_string_tab[24]
#define __pyx_kp_u_FlightServerBase_list_flights_mu __pyx_string_tab[25]
#define __pyx_kp_u_FlightStreamChunk_with_data __pyx_string_tab[26]
#define __pyx_kp_u_Flight_RPC_failed_with_Python_ex __pyx_string_tab[27]
#define __pyx_kp_u_Flight_RPC_failed_with_message_D __pyx_string_tab[28]
#define __pyx_kp_u_Flight_error __pyx_string_tab[29]
#define __pyx_kp_u_GeneratorStream_must_be_initiali __pyx_string_tab[30]
#define __pyx_kp_u_Got_a_FlightDataStream_whose_sch __pyx_string_tab[31]
#define __pyx_kp_u_Got_a_RecordBatch_whose_schema_d __pyx_string_tab[32]
#define __pyx_kp_u_Information_about_a_particular_R __pyx_string_tab[33]
#define __pyx_kp_u_Invalid_descriptor_type __pyx_string_tab[34]
#define __pyx_kp_u_Middleware_key_cannot_be __pyx_string_tab[35]
#define __pyx_kp_u_Must_provide_Action_not __pyx_string_tab[36]
#define __pyx_kp_u_Must_provide_a_FlightDescriptor __pyx_string_tab[37]
#define __pyx_kp_u_Must_provide_a_Location_not __pyx_string_tab[38]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[39]
#define __pyx_kp_u_Operation_on_closed_reader __pyx_string_tab[40]
#define __pyx_kp_u_Results_of_list_actions_must_be __pyx_string_tab[41]
#define __pyx_kp_u_State_for_an_async_RPC_using_asy __pyx_string_tab[42]
#define __pyx_kp_u_The_FlightClient_connect_method __pyx_string_tab[43]
#define __pyx_kp_u_The_FlightServer_run_method_is_d __pyx_string_tab[44]
#define __pyx_kp_u_The_implemented_methods_in_Fligh __pyx_string_tab[45]
#define __pyx_kp_u_The_parameter_chunksize_is_depre __pyx_string_tab[46]
#define __pyx_kp_u_The_type_of_a_FlightDescriptor __pyx_string_tab[47]
#define __pyx_kp_u_While_getting_next_payload_ran_o __pyx_string_tab[48]
#define __pyx_kp_u__2 __pyx_string_tab[49]
#define __pyx_kp_u__3 __pyx_string_tab[50]
#define __pyx_kp_u__4 __pyx_string_tab[51]
#define __pyx_kp_u__5 __pyx_string_tab[52]
#define __pyx_kp_u__6 __pyx_string_tab[53]
#define __pyx_kp_u__7 __pyx_string_tab[54]
#define __pyx_kp_u__8 __pyx_string_tab[55]
#define __pyx_kp_u__9 __pyx_string_tab[56]
#define __pyx_kp_u_add_note __pyx_string_tab[57]
#define __pyx_kp_u_app_metadata_2 __pyx_string_tab[58]
#define __pyx_kp_u_auth_handler_must_be_a_ServerAut __pyx_string_tab[59]
#define __pyx_kp_u_bin __pyx_string_tab[60]
#define __pyx_kp_u_body __pyx_string_tab[61]
#define __pyx_kp_u_bytes __pyx_string_tab[62]
#define __pyx_kp_u_descriptor_2 __pyx_string_tab[63]
#define __pyx_kp_u_disable __pyx_string_tab[64]
#define __pyx_kp_u_enable __pyx_string_tab[65]
#define __pyx_kp_u_endpoints_2 __pyx_string_tab[66]
#define __pyx_kp_u_expected_IpcReadOptions_got __pyx_string_tab[67]
#define __pyx_kp_u_expiration_time_2 __pyx_string_tab[68]
#define __pyx_kp_u_gc __pyx_string_tab[69]
#define __pyx_kp_u_headers_2 __pyx_string_tab[70]
#define __pyx_kp_u_is_not_instance_of_FlightEndpoi __pyx_string_tab[71]
#define __pyx_kp_u_isenabled __pyx_string_tab[72]
#define __pyx_kp_u_location_argument_must_be_a_str __pyx_string_tab[73]
#define __pyx_kp_u_locations_2 __pyx_string_tab[74]
#define __pyx_kp_u_ordered_2 __pyx_string_tab[75]
#define __pyx_kp_u_password_redacted __pyx_string_tab[76]
#define __pyx_kp_u_pyarrow__flight_pyx __pyx_string_tab[77]
#define __pyx_kp_u_pyarrow_flight_Action_type __pyx_string_tab[78]
#define __pyx_kp_u_pyarrow_flight_BasicAuth_userna __pyx_string_tab[79]
#define __pyx_kp_u_pyarrow_flight_FlightCallOption __pyx_string_tab[80]
#define __pyx_kp_u_pyarrow_flight_FlightDescriptor __pyx_string_tab[81]
#define __pyx_kp_u_pyarrow_flight_FlightDescriptor_2 __pyx_string_tab[82]
#define __pyx_kp_u_pyarrow_flight_FlightDescriptor_3 __pyx_string_tab[83]
#define __pyx_kp_u_pyarrow_flight_FlightEndpoint_t __pyx_string_tab[84]
#define __pyx_kp_u_pyarrow_flight_FlightInfo_schem __pyx_string_tab[85]
#define __pyx_kp_u_pyarrow_flight_Location __pyx_string_tab[86]
#define __pyx_kp_u_pyarrow_flight_Result_body __pyx_string_tab[87]
#define __pyx_kp_u_pyarrow_flight_SchemaResult_sch __pyx_string_tab[88]
#define __pyx_kp_u_pyarrow_flight_Ticket_ticket __pyx_string_tab[89]
#define __pyx_kp_u_read_options_2 __pyx_string_tab[90]
#define __pyx_kp_u_run_on_uninitialized_FlightServe __pyx_string_tab[91]
#define __pyx_kp_u_s_constructor_directly_use_pyar __pyx_string_tab[92]
#define __pyx_kp_u_self_action_cannot_be_converted __pyx_string_tab[93]
#define __pyx_kp_u_self_basic_auth_cannot_be_conver __pyx_string_tab[94]
#define __pyx_kp_u_self_c_options_self_current_stre __pyx_string_tab[95]
#define __pyx_kp_u_self_c_ticket_cannot_be_converte __pyx_string_tab[96]
#define __pyx_kp_u_self_chunk_cannot_be_converted_t __pyx_string_tab[97]
#define __pyx_kp_u_self_client_cannot_be_converted __pyx_string_tab[98]
#define __pyx_kp_u_self_context_cannot_be_converted __pyx_string_tab[99]
#define __pyx_kp_u_self_descriptor_cannot_be_conver __pyx_string_tab[100]
#define __pyx_kp_u_self_endpoint_cannot_be_converte __pyx_string_tab[101]
#define __pyx_kp_u_self_info_cannot_be_converted_to __pyx_string_tab[102]
#define __pyx_kp_u_self_location_cannot_be_converte __pyx_string_tab[103]
#define __pyx_kp_u_self_object_in_callback_is_not_G __pyx_string_tab[104]
#define __pyx_kp_u_self_options_cannot_be_converted __pyx_string_tab[105]
#define __pyx_kp_u_self_reader_cannot_be_converted __pyx_string_tab[106]
#define __pyx_kp_u_self_result_cannot_be_converted __pyx_string_tab[107]
#define __pyx_kp_u_self_sender_cannot_be_converted __pyx_string_tab[108]
#define __pyx_kp_u_self_server_cannot_be_converted __pyx_string_tab[109]
#define __pyx_kp_u_self_write_options_cannot_be_con __pyx_string_tab[110]
#define __pyx_kp_u_self_writer_cannot_be_converted __pyx_string_tab[111]
#define __pyx_kp_u_shutdown_on_uninitialized_Flight __pyx_string_tab[112]
#define __pyx_kp_u_total_bytes_2 __pyx_string_tab[113]
#define __pyx_kp_u_total_records_2 __pyx_string_tab[114]
#define __pyx_kp_u_tree_fragment __pyx_string_tab[115]
#define __pyx_kp_u_with_metadata __pyx_string_tab[116]
#define __pyx_kp_u_write_options_2 __pyx_string_tab[117]
#define __pyx_n_u_Action __pyx_string_tab[118]
#define __pyx_n_u_ActionType __pyx_string_tab[119]
#define __pyx_n_u_ActionType_2 __pyx_string_tab[120]
#define __pyx_n_u_ActionType_make_action __pyx_string_tab[121]
#define __pyx_n_u_Action___reduce_cython __pyx_string_tab[122]
#define __pyx_n_u_Action___setstate_cython __pyx_string_tab[123]
#define __pyx_n_u_Action_deserialize __pyx_string_tab[124]
#define __pyx_n_u_Action_serialize __pyx_string_tab[125]
#define __pyx_n_u_ArrowCancelled __pyx_string_tab[126]
#define __pyx_n_u_ArrowException __pyx_string_tab[127]
#define __pyx_n_u_ArrowInvalid __pyx_string_tab[128]
#define __pyx_n_u_AsyncioCall __pyx_string_tab[129]
#define __pyx_n_u_AsyncioCall___init __pyx_string_tab[130]
#define __pyx_n_u_AsyncioCall_as_awaitable __pyx_string_tab[131]
#define __pyx_n_u_AsyncioCall_wakeup __pyx_string_tab[132]
#define __pyx_n_u_AsyncioFlightClient __pyx_string_tab[133]
#define __pyx_n_u_AsyncioFlightClient___reduce_cyt __pyx_string_tab[134]
#define __pyx_n_u_AsyncioFlightClient___setstate_c __pyx_string_tab[135]
#define __pyx_n_u_AsyncioFlightClient_get_flight_i __pyx_string_tab[136]
#define __pyx_n_u_BasicAuth __pyx_string_tab[137]
#define __pyx_n_u_BasicAuth___reduce_cython __pyx_string_tab[138]
#define __pyx_n_u_BasicAuth___setstate_cython __pyx_string_tab[139]
#define __pyx_n_u_BasicAuth_deserialize __pyx_string_tab[140]
#define __pyx_n_u_BasicAuth_serialize __pyx_string_tab[141]
#define __pyx_n_u_CMD __pyx_string_tab[142]
#define __pyx_n_u_CallInfo __pyx_string_tab[143]
#define __pyx_n_u_CallInfo_2 __pyx_string_tab[144]
#define __pyx_n_u_CertKeyPair __pyx_string_tab[145]
#define __pyx_n_u_CertKeyPair_2 __pyx_string_tab[146]
#define __pyx_n_u_ClientAuthHandler __pyx_string_tab[147]
#define __pyx_n_u_ClientAuthHandler___reduce_cytho __pyx_string_tab[148]
#define __pyx_n_u_ClientAuthHandler___setstate_cyt __pyx_string_tab[149]
#define __pyx_n_u_ClientAuthHandler_authenticate __pyx_string_tab[150]
#define __pyx_n_u_ClientAuthHandler_get_token __pyx_string_tab[151]
#define __pyx_n_u_ClientAuthReader __pyx_string_tab[152]
#define __pyx_n_u_ClientAuthReader___reduce_cython __pyx_string_tab[153]
#define __pyx_n_u_ClientAuthReader___setstate_cyth __pyx_string_tab[154]
#define __pyx_n_u_ClientAuthReader_read __pyx_string_tab[155]
#define __pyx_n_u_ClientAuthSender __pyx_string_tab[156]
#define __pyx_n_u_ClientAuthSender___reduce_cython __pyx_string_tab[157]
#define __pyx_n_u_ClientAuthSender___setstate_cyth __pyx_string_tab[158]
#define __pyx_n_u_ClientAuthSender_write __pyx_string_tab[159]
#define __pyx_n_u_ClientMiddleware __pyx_string_tab[160]
#define __pyx_n_u_ClientMiddlewareFactory __pyx_string_tab[161]
#define __pyx_n_u_ClientMiddlewareFactory___reduce __pyx_string_tab[162]
#define __pyx_n_u_ClientMiddlewareFactory___setsta __pyx_string_tab[163]
#define __pyx_n_u_ClientMiddlewareFactory_start_ca __pyx_string_tab[164]
#define __pyx_n_u_ClientMiddleware___reduce_cython __pyx_string_tab[165]
#define __pyx_n_u_ClientMiddleware___setstate_cyth __pyx_string_tab[166]
#define __pyx_n_u_ClientMiddleware_call_completed __pyx_string_tab[167]
#define __pyx_n_u_ClientMiddleware_received_header __pyx_string_tab[168]
#define __pyx_n_u_ClientMiddleware_sending_headers __pyx_string_tab[169]
#define __pyx_n_u_DOTALL __pyx_string_tab[170]
#define __pyx_n_u_DO_ACTION __pyx_string_tab[171]
#define __pyx_n_u_DO_EXCHANGE __pyx_string_tab[172]
#define __pyx_n_u_DO_GET __pyx_string_tab[173]
#define __pyx_n_u_DO_PUT __pyx_string_tab[174]
#define __pyx_n_u_DescriptorType __pyx_string_tab[175]
#define __pyx_n_u_Enum __pyx_string_tab[176]
#define __pyx_n_u_FLIGHT_SERVER_ERROR_REGEX __pyx_string_tab[177]
#define __pyx_n_u_False __pyx_string_tab[178]
#define __pyx_n_u_FlightCallOptions __pyx_string_tab[179]
#define __pyx_n_u_FlightCallOptions___reduce_cytho __pyx_string_tab[180]
#define __pyx_n_u_FlightCallOptions___setstate_cyt __pyx_string_tab[181]
#define __pyx_n_u_FlightCancelledError __pyx_string_tab[182]
#define __pyx_n_u_FlightCancelledError___reduce_cy __pyx_string_tab[183]
#define __pyx_n_u_FlightCancelledError___setstate __pyx_string_tab[184]
#define __pyx_n_u_FlightClient __pyx_string_tab[185]
#define __pyx_n_u_FlightClient___enter __pyx_string_tab[186]
#define __pyx_n_u_FlightClient___exit __pyx_string_tab[187]
#define __pyx_n_u_FlightClient___reduce_cython __pyx_string_tab[188]
#define __pyx_n_u_FlightClient___setstate_cython __pyx_string_tab[189]
#define __pyx_n_u_FlightClient_as_async __pyx_string_tab[190]
#define __pyx_n_u_FlightClient_authenticate __pyx_string_tab[191]
#define __pyx_n_u_FlightClient_authenticate_basic __pyx_string_tab[192]
#define __pyx_n_u_FlightClient_close __pyx_string_tab[193]
#define __pyx_n_u_FlightClient_connect __pyx_string_tab[194]
#define __pyx_n_u_FlightClient_do_action __pyx_string_tab[195]
#define __pyx_n_u_FlightClient_do_exchange __pyx_string_tab[196]
#define __pyx_n_u_FlightClient_do_get __pyx_string_tab[197]
#define __pyx_n_u_FlightClient_do_put __pyx_string_tab[198]
#define __pyx_n_u_FlightClient_get_flight_info __pyx_string_tab[199]
#define __pyx_n_u_FlightClient_get_schema __pyx_string_tab[200]
#define __pyx_n_u_FlightClient_list_actions __pyx_string_tab[201]
#define __pyx_n_u_FlightClient_list_flights __pyx_string_tab[202]
#define __pyx_n_u_FlightClient_wait_for_available __pyx_string_tab[203]
#define __pyx_n_u_FlightDataStream __pyx_string_tab[204]
#define __pyx_n_u_FlightDataStream___reduce_cython __pyx_string_tab[205]
#define __pyx_n_u_FlightDataStream___setstate_cyth __pyx_string_tab[206]
#define __pyx_n_u_FlightDescriptor __pyx_string_tab[207]
#define __pyx_n_u_FlightDescriptor___reduce_cython __pyx_string_tab[208]
#define __pyx_n_u_FlightDescriptor___setstate_cyth __pyx_string_tab[209]
#define __pyx_n_u_FlightDescriptor_deserialize __pyx_string_tab[210]
#define __pyx_n_u_FlightDescriptor_for_command __pyx_string_tab[211]
#define __pyx_n_u_FlightDescriptor_for_path __pyx_string_tab[212]
#define __pyx_n_u_FlightDescriptor_serialize __pyx_string_tab[213]
#define __pyx_n_u_FlightEndpoint __pyx_string_tab[214]
#define __pyx_n_u_FlightEndpoint___reduce_cython __pyx_string_tab[215]
#define __pyx_n_u_FlightEndpoint___setstate_cython __pyx_string_tab[216]
#define __pyx_n_u_FlightEndpoint_deserialize __pyx_string_tab[217]
#define __pyx_n_u_FlightEndpoint_serialize __pyx_string_tab[218]
#define __pyx_n_u_FlightError __pyx_string_tab[219]
#define __pyx_n_u_FlightError___reduce_cython __pyx_string_tab[220]
#define __pyx_n_u_FlightError___setstate_cython __pyx_string_tab[221]
#define __pyx_n_u_FlightInfo __pyx_string_tab[222]
#define __pyx_n_u_FlightInfo___reduce_cython __pyx_string_tab[223]
#define __pyx_n_u_FlightInfo___setstate_cython __pyx_string_tab[224]
#define __pyx_n_u_FlightInfo_deserialize __pyx_string_tab[225]
#define __pyx_n_u_FlightInfo_serialize __pyx_string_tab[226]
#define __pyx_n_u_FlightInternalError __pyx_string_tab[227]
#define __pyx_n_u_FlightInternalError___reduce_cyt __pyx_string_tab[228]
#define __pyx_n_u_FlightInternalError___setstate_c __pyx_string_tab[229]
#define __pyx_n_u_FlightMetadataReader __pyx_string_tab[230]
#define __pyx_n_u_FlightMetadataReader___reduce_cy __pyx_string_tab[231]
#define __pyx_n_u_FlightMetadataReader___setstate __pyx_string_tab[232]
#define __pyx_n_u_FlightMetadataReader_read __pyx_string_tab[233]
#define __pyx_n_u_FlightMetadataWriter __pyx_string_tab[234]
#define __pyx_n_u_FlightMetadataWriter___reduce_cy __pyx_string_tab[235]
#define __pyx_n_u_FlightMetadataWriter___setstate __pyx_string_tab[236]
#define __pyx_n_u_FlightMetadataWriter_write __pyx_string_tab[237]
#define __pyx_n_u_FlightMethod __pyx_string_tab[238]
#define __pyx_n_u_FlightServerBase __pyx_string_tab[239]
#define __pyx_n_u_FlightServerBase___enter __pyx_string_tab[240]
#define __pyx_n_u_FlightServerBase___exit __pyx_string_tab[241]
#define __pyx_n_u_FlightServerBase___reduce_cython __pyx_string_tab[242]
#define __pyx_n_u_FlightServerBase___setstate_cyth __pyx_string_tab[243]
#define __pyx_n_u_FlightServerBase_do_action __pyx_string_tab[244]
#define __pyx_n_u_FlightServerBase_do_exchange __pyx_string_tab[245]
#define __pyx_n_u_FlightServerBase_do_get __pyx_string_tab[246]
#define __pyx_n_u_FlightServerBase_do_put __pyx_string_tab[247]
#define __pyx_n_u_FlightServerBase_get_flight_info_2 __pyx_string_tab[248]
#define __pyx_n_u_FlightServerBase_get_schema __pyx_string_tab[249]
#define __pyx_n_u_FlightServerBase_list_actions __pyx_string_tab[250]
#define __pyx_n_u_FlightServerBase_list_flights __pyx_string_tab[251]
#define __pyx_n_u_FlightServerBase_run __pyx_string_tab[252]
#define __pyx_n_u_FlightServerBase_serve __pyx_string_tab[253]
#define __pyx_n_u_FlightServerBase_shutdown __pyx_string_tab[254]
#define __pyx_n_u_FlightServerBase_wait __pyx_string_tab[255]
#define __pyx_n_u_FlightServerError __pyx_string_tab[256]
#define __pyx_n_u_FlightServerError___reduce_cytho __pyx_string_tab[257]
#define __pyx_n_u_FlightServerError___setstate_cyt __pyx_string_tab[258]
#define __pyx_n_u_FlightServerFinalizer __pyx_string_tab[259]
#define __pyx_n_u_FlightServerFinalizer___reduce __pyx_string_tab[260]
#define __pyx_n_u_FlightServerFinalizer___setstat __pyx_string_tab[261]
#define __pyx_n_u_FlightServerFinalizer_finalize __pyx_string_tab[262]
#define __pyx_n_u_FlightStreamChunk __pyx_string_tab[263]
#define __pyx_n_u_FlightStreamChunk___reduce_cytho __pyx_string_tab[264]
#define __pyx_n_u_FlightStreamChunk___setstate_cyt __pyx_string_tab[265]
#define __pyx_n_u_FlightStreamReader __pyx_string_tab[266]
#define __pyx_n_u_FlightStreamReader___reduce_cyth __pyx_string_tab[267]
#define __pyx_n_u_FlightStreamReader___setstate_cy __pyx_string_tab[268]
#define __pyx_n_u_FlightStreamReader_cancel __pyx_string_tab[269]
#define __pyx_n_u_FlightStreamReader_read_all __pyx_string_tab[270]
#define __pyx_n_u_FlightStreamWriter __pyx_string_tab[271]
#define __pyx_n_u_FlightStreamWriter___reduce_cyth __pyx_string_tab[272]
#define __pyx_n_u_FlightStreamWriter___setstate_cy __pyx_string_tab[273]
#define __pyx_n_u_FlightStreamWriter_done_writing __pyx_string_tab[274]
#define __pyx_n_u_FlightTimedOutError __pyx_string_tab[275]
#define __pyx_n_u_FlightTimedOutError___reduce_cyt __pyx_string_tab[276]
#define __pyx_n_u_FlightTimedOutError___setstate_c __pyx_string_tab[277]
#define __pyx_n_u_FlightUnauthenticatedError __pyx_string_tab[278]
#define __pyx_n_u_FlightUnauthenticatedError___red __pyx_string_tab[279]
#define __pyx_n_u_FlightUnauthenticatedError___set __pyx_string_tab[280]
#define __pyx_n_u_FlightUnauthorizedError __pyx_string_tab[281]
#define __pyx_n_u_FlightUnauthorizedError___reduce __pyx_string_tab[282]
#define __pyx_n_u_FlightUnauthorizedError___setsta __pyx_string_tab[283]
#define __pyx_n_u_FlightUnavailableError __pyx_string_tab[284]
#define __pyx_n_u_FlightUnavailableError___reduce __pyx_string_tab[285]
#define __pyx_n_u_FlightUnavailableError___setstat __pyx_string_tab[286]
#define __pyx_n_u_FlightWriteSizeExceededError __pyx_string_tab[287]
#define __pyx_n_u_FlightWriteSizeExceededError___i __pyx_string_tab[288]
#define __pyx_n_u_GET_FLIGHT_INFO __pyx_string_tab[289]
#define __pyx_n_u_GET_SCHEMA __pyx_string_tab[290]
#define __pyx_n_u_GeneratorStream __pyx_string_tab[291]
#define __pyx_n_u_GeneratorStream___reduce_cython __pyx_string_tab[292]
#define __pyx_n_u_GeneratorStream___setstate_cytho __pyx_string_tab[293]
#define __pyx_n_u_HANDSHAKE __pyx_string_tab[294]
#define __pyx_n_u_INVALID __pyx_string_tab[295]
#define __pyx_n_u_LIST_ACTIONS __pyx_string_tab[296]
#define __pyx_n_u_LIST_FLIGHTS __pyx_string_tab[297]
#define __pyx_n_u_Location __pyx_string_tab[298]
#define __pyx_n_u_Location___reduce_cython __pyx_string_tab[299]
#define __pyx_n_u_Location___setstate_cython __pyx_string_tab[300]
#define __pyx_n_u_Location_equals __pyx_string_tab[301]
#define __pyx_n_u_Location_for_grpc_tcp __pyx_string_tab[302]
#define __pyx_n_u_Location_for_grpc_tls __pyx_string_tab[303]
#define __pyx_n_u_Location_for_grpc_unix __pyx_string_tab[304]
#define __pyx_n_u_MetadataRecordBatchReader __pyx_string_tab[305]
#define __pyx_n_u_MetadataRecordBatchReader_2 __pyx_string_tab[306]
#define __pyx_n_u_MetadataRecordBatchReader___red __pyx_string_tab[307]
#define __pyx_n_u_MetadataRecordBatchReader___redu __pyx_string_tab[308]
#define __pyx_n_u_MetadataRecordBatchReader___set __pyx_string_tab[309]
#define __pyx_n_u_MetadataRecordBatchReader___sets __pyx_string_tab[310]
#define __pyx_n_u_MetadataRecordBatchReader_read __pyx_string_tab[311]
#define __pyx_n_u_MetadataRecordBatchReader_read_2 __pyx_string_tab[312]
#define __pyx_n_u_MetadataRecordBatchReader_to_re __pyx_string_tab[313]
#define __pyx_n_u_MetadataRecordBatchWriter __pyx_string_tab[314]
#define __pyx_n_u_MetadataRecordBatchWriter___redu __pyx_string_tab[315]
#define __pyx_n_u_MetadataRecordBatchWriter___sets __pyx_string_tab[316]
#define __pyx_n_u_MetadataRecordBatchWriter_begin __pyx_string_tab[317]
#define __pyx_n_u_MetadataRecordBatchWriter_close __pyx_string_tab[318]
#define __pyx_n_u_MetadataRecordBatchWriter_write __pyx_string_tab[319]
#define __pyx_n_u_MetadataRecordBatchWriter_write_2 __pyx_string_tab[320]
#define __pyx_n_u_MetadataRecordBatchWriter_write_3 __pyx_string_tab[321]
#define __pyx_n_u_MetadataRecordBatchWriter_write_4 __pyx_string_tab[322]
#define __pyx_n_u_None __pyx_string_tab[323]
#define __pyx_n_u_NotImplemented __pyx_string_tab[324]
#define __pyx_n_u_PATH __pyx_string_tab[325]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[326]
#define __pyx_n_u_ReadPandasMixin __pyx_string_tab[327]
#define __pyx_n_u_RecordBatchStream __pyx_string_tab[328]
#define __pyx_n_u_RecordBatchStream___reduce_cytho __pyx_string_tab[329]
#define __pyx_n_u_RecordBatchStream___setstate_cyt __pyx_string_tab[330]
#define __pyx_n_u_Result __pyx_string_tab[331]
#define __pyx_n_u_Result___reduce_cython __pyx_string_tab[332]
#define __pyx_n_u_Result___setstate_cython __pyx_string_tab[333]
#define __pyx_n_u_Result_deserialize __pyx_string_tab[334]
#define __pyx_n_u_Result_serialize __pyx_string_tab[335]
#define __pyx_n_u_Schema __pyx_string_tab[336]
#define __pyx_n_u_SchemaResult __pyx_string_tab[337]
#define __pyx_n_u_SchemaResult___reduce_cython __pyx_string_tab[338]
#define __pyx_n_u_SchemaResult___setstate_cython __pyx_string_tab[339]
#define __pyx_n_u_SchemaResult_deserialize __pyx_string_tab[340]
#define __pyx_n_u_SchemaResult_serialize __pyx_string_tab[341]
#define __pyx_n_u_ServerAuthHandler __pyx_string_tab[342]
#define __pyx_n_u_ServerAuthHandler___reduce_cytho __pyx_string_tab[343]
#define __pyx_n_u_ServerAuthHandler___setstate_cyt __pyx_string_tab[344]
#define __pyx_n_u_ServerAuthHandler_authenticate __pyx_string_tab[345]
#define __pyx_n_u_ServerAuthHandler_is_valid __pyx_string_tab[346]
#define __pyx_n_u_ServerAuthReader __pyx_string_tab[347]
#define __pyx_n_u_ServerAuthReader___reduce_cython __pyx_string_tab[348]
#define __pyx_n_u_ServerAuthReader___setstate_cyth __pyx_string_tab[349]
#define __pyx_n_u_ServerAuthReader_read __pyx_string_tab[350]
#define __pyx_n_u_ServerAuthSender __pyx_string_tab[351]
#define __pyx_n_u_ServerAuthSender___reduce_cython __pyx_string_tab[352]
#define __pyx_n_u_ServerAuthSender___setstate_cyth __pyx_string_tab[353]
#define __pyx_n_u_ServerAuthSender_write __pyx_string_tab[354]
#define __pyx_n_u_ServerCallContext __pyx_string_tab[355]
#define __pyx_n_u_ServerCallContext___reduce_cytho __pyx_string_tab[356]
#define __pyx_n_u_ServerCallContext___setstate_cyt __pyx_string_tab[357]
#define __pyx_n_u_ServerCallContext_add_header __pyx_string_tab[358]
#define __pyx_n_u_ServerCallContext_add_trailer __pyx_string_tab[359]
#define __pyx_n_u_ServerCallContext_get_middleware __pyx_string_tab[360]
#define __pyx_n_u_ServerCallContext_is_cancelled __pyx_string_tab[361]
#define __pyx_n_u_ServerCallContext_peer __pyx_string_tab[362]
#define __pyx_n_u_ServerCallContext_peer_identity __pyx_string_tab[363]
#define __pyx_n_u_ServerMiddleware __pyx_string_tab[364]
#define __pyx_n_u_ServerMiddlewareFactory __pyx_string_tab[365]
#define __pyx_n_u_ServerMiddlewareFactoryWrapper __pyx_string_tab[366]
#define __pyx_n_u_ServerMiddlewareFactoryWrapper_2 __pyx_string_tab[367]
#define __pyx_n_u_ServerMiddlewareFactoryWrapper_3 __pyx_string_tab[368]
#define __pyx_n_u_ServerMiddlewareFactoryWrapper_4 __pyx_string_tab[369]
#define __pyx_n_u_ServerMiddlewareFactory___reduce __pyx_string_tab[370]
#define __pyx_n_u_ServerMiddlewareFactory___setsta __pyx_string_tab[371]
#define __pyx_n_u_ServerMiddlewareFactory_start_ca __pyx_string_tab[372]
#define __pyx_n_u_ServerMiddlewareWrapper __pyx_string_tab[373]
#define __pyx_n_u_ServerMiddlewareWrapper___reduc __pyx_string_tab[374]
#define __pyx_n_u_ServerMiddlewareWrapper___setst __pyx_string_tab[375]
#define __pyx_n_u_ServerMiddlewareWrapper_call_co __pyx_string_tab[376]
#define __pyx_n_u_ServerMiddlewareWrapper_sending __pyx_string_tab[377]
#define __pyx_n_u_ServerMiddleware___reduce_cython __pyx_string_tab[378]
#define __pyx_n_u_ServerMiddleware___setstate_cyth __pyx_string_tab[379]
#define __pyx_n_u_ServerMiddleware_call_completed __pyx_string_tab[380]
#define __pyx_n_u_ServerMiddleware_sending_headers __pyx_string_tab[381]
#define __pyx_n_u_SignalStopHandler __pyx_string_tab[382]
#define __pyx_n_u_Table __pyx_string_tab[383]
#define __pyx_n_u_Ticket __pyx_string_tab[384]
#define __pyx_n_u_Ticket___reduce_cython __pyx_string_tab[385]
#define __pyx_n_u_Ticket___setstate_cython __pyx_string_tab[386]
#define __pyx_n_u_Ticket_deserialize __pyx_string_tab[387]
#define __pyx_n_u_Ticket_serialize __pyx_string_tab[388]
#define __pyx_n_u_TimestampScalar __pyx_string_tab[389]
#define __pyx_n_u_TracingServerMiddleware __pyx_string_tab[390]
#define __pyx_n_u_TracingServerMiddlewareFactory __pyx_string_tab[391]
#define __pyx_n_u_TracingServerMiddlewareFactory_2 __pyx_string_tab[392]
#define __pyx_n_u_TracingServerMiddlewareFactory_3 __pyx_string_tab[393]
#define __pyx_n_u_TracingServerMiddleware___init __pyx_string_tab[394]
#define __pyx_n_u_True __pyx_string_tab[395]
#define __pyx_n_u_UNKNOWN __pyx_string_tab[396]
#define __pyx_n_u_UTC __pyx_string_tab[397]
#define __pyx_n_u_action __pyx_string_tab[398]
#define __pyx_n_u_action_type __pyx_string_tab[399]
#define __pyx_n_u_actual __pyx_string_tab[400]
#define __pyx_n_u_add_header __pyx_string_tab[401]
#define __pyx_n_u_add_trailer __pyx_string_tab[402]
#define __pyx_n_u_app_metadata __pyx_string_tab[403]
#define __pyx_n_u_append __pyx_string_tab[404]
#define __pyx_n_u_as_async __pyx_string_tab[405]
#define __pyx_n_u_as_awaitable __pyx_string_tab[406]
#define __pyx_n_u_as_buffer __pyx_string_tab[407]
#define __pyx_n_u_ascii __pyx_string_tab[408]
#define __pyx_n_u_asyncio __pyx_string_tab[409]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[410]
#define __pyx_n_u_auth __pyx_string_tab[411]
#define __pyx_n_u_auth_handler __pyx_string_tab[412]
#define __pyx_n_u_authenticate __pyx_string_tab[413]
#define __pyx_n_u_authenticate_basic_token __pyx_string_tab[414]
#define __pyx_n_u_await __pyx_string_tab[415]
#define __pyx_n_u_batch __pyx_string_tab[416]
#define __pyx_n_u_begin __pyx_string_tab[417]
#define __pyx_n_u_body_2 __pyx_string_tab[418]
#define __pyx_n_u_buf __pyx_string_tab[419]
#define __pyx_n_u_bytes_2 __pyx_string_tab[420]
#define __pyx_n_u_c_action __pyx_string_tab[421]
#define __pyx_n_u_c_buf __pyx_string_tab[422]
#define __pyx_n_u_c_criteria __pyx_string_tab[423]
#define __pyx_n_u_c_descriptor __pyx_string_tab[424]
#define __pyx_n_u_c_do_exchange_result __pyx_string_tab[425]
#define __pyx_n_u_c_do_put_result __pyx_string_tab[426]
#define __pyx_n_u_c_host __pyx_string_tab[427]
#define __pyx_n_u_c_max_chunksize __pyx_string_tab[428]
#define __pyx_n_u_c_message __pyx_string_tab[429]
#define __pyx_n_u_c_middleware __pyx_string_tab[430]
#define __pyx_n_u_c_options __pyx_string_tab[431]
#define __pyx_n_u_c_path __pyx_string_tab[432]
#define __pyx_n_u_c_port __pyx_string_tab[433]
#define __pyx_n_u_c_schema __pyx_string_tab[434]
#define __pyx_n_u_c_table __pyx_string_tab[435]
#define __pyx_n_u_c_trace_context __pyx_string_tab[436]
#define __pyx_n_u_call __pyx_string_tab[437]
#define __pyx_n_u_call_completed __pyx_string_tab[438]
#define __pyx_n_u_call_soon_threadsafe __pyx_string_tab[439]
#define __pyx_n_u_cancel __pyx_string_tab[440]
#define __pyx_n_u_cast __pyx_string_tab[441]
#define __pyx_n_u_cert __pyx_string_tab[442]
#define __pyx_n_u_cert_chain __pyx_string_tab[443]
#define __pyx_n_u_chunk __pyx_string_tab[444]
#define __pyx_n_u_chunksize __pyx_string_tab[445]
#define __pyx_n_u_class __pyx_string_tab[446]
#define __pyx_n_u_class_getitem __pyx_string_tab[447]
#define __pyx_n_u_client __pyx_string_tab[448]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[449]
#define __pyx_n_u_close __pyx_string_tab[450]
#define __pyx_n_u_cls __pyx_string_tab[451]
#define __pyx_n_u_collections __pyx_string_tab[452]
#define __pyx_n_u_command __pyx_string_tab[453]
#define __pyx_n_u_compile __pyx_string_tab[454]
#define __pyx_n_u_connect __pyx_string_tab[455]
#define __pyx_n_u_context __pyx_string_tab[456]
#define __pyx_n_u_create_future __pyx_string_tab[457]
#define __pyx_n_u_criteria __pyx_string_tab[458]
#define __pyx_n_u_custom_metadata __pyx_string_tab[459]
#define __pyx_n_u_data __pyx_string_tab[460]
#define __pyx_n_u_data_source __pyx_string_tab[461]
#define __pyx_n_u_deadline __pyx_string_tab[462]
#define __pyx_n_u_decode __pyx_string_tab[463]
#define __pyx_n_u_defaultdict __pyx_string_tab[464]
#define __pyx_n_u_description __pyx_string_tab[465]
#define __pyx_n_u_descriptor __pyx_string_tab[466]
#define __pyx_n_u_descriptor_type __pyx_string_tab[467]
#define __pyx_n_u_deserialize __pyx_string_tab[468]
#define __pyx_n_u_dict __pyx_string_tab[469]
#define __pyx_n_u_dict_2 __pyx_string_tab[470]
#define __pyx_n_u_disable_server_verification __pyx_string_tab[471]
#define __pyx_n_u_do_action __pyx_string_tab[472]
#define __pyx_n_u_do_action_locals__do_action_resp __pyx_string_tab[473]
#define __pyx_n_u_do_action_response __pyx_string_tab[474]
#define __pyx_n_u_do_exchange __pyx_string_tab[475]
#define __pyx_n_u_do_get __pyx_string_tab[476]
#define __pyx_n_u_do_put __pyx_string_tab[477]
#define __pyx_n_u_doc __pyx_string_tab[478]
#define __pyx_n_u_done_writing __pyx_string_tab[479]
#define __pyx_n_u_encode __pyx_string_tab[480]
#define __pyx_n_u_endpoint __pyx_string_tab[481]
#define __pyx_n_u_endpoints __pyx_string_tab[482]
#define __pyx_n_u_endswith __pyx_string_tab[483]
#define __pyx_n_u_enter __pyx_string_tab[484]
#define __pyx_n_u_enum __pyx_string_tab[485]
#define __pyx_n_u_equals __pyx_string_tab[486]
#define __pyx_n_u_exc_type __pyx_string_tab[487]
#define __pyx_n_u_exc_value __pyx_string_tab[488]
#define __pyx_n_u_exception __pyx_string_tab[489]
#define __pyx_n_u_exit __pyx_string_tab[490]
#define __pyx_n_u_expiration_time __pyx_string_tab[491]
#define __pyx_n_u_extend __pyx_string_tab[492]
#define __pyx_n_u_extra_info __pyx_string_tab[493]
#define __pyx_n_u_factories __pyx_string_tab[494]
#define __pyx_n_u_factory __pyx_string_tab[495]
#define __pyx_n_u_finalize __pyx_string_tab[496]
#define __pyx_n_u_for_command __pyx_string_tab[497]
#define __pyx_n_u_for_grpc_tcp __pyx_string_tab[498]
#define __pyx_n_u_for_grpc_tls __pyx_string_tab[499]
#define __pyx_n_u_for_grpc_unix __pyx_string_tab[500]
#define __pyx_n_u_for_path __pyx_string_tab[501]
#define __pyx_n_u_frombytes __pyx_string_tab[502]
#define __pyx_n_u_func __pyx_string_tab[503]
#define __pyx_n_u_future __pyx_string_tab[504]
#define __pyx_n_u_generator __pyx_string_tab[505]
#define __pyx_n_u_generic_options __pyx_string_tab[506]
#define __pyx_n_u_get __pyx_string_tab[507]
#define __pyx_n_u_get_flight_info __pyx_string_tab[508]
#define __pyx_n_u_get_legacy_format_default __pyx_string_tab[509]
#define __pyx_n_u_get_loop __pyx_string_tab[510]
#define __pyx_n_u_get_middleware __pyx_string_tab[511]
#define __pyx_n_u_get_running_loop __pyx_string_tab[512]
#define __pyx_n_u_get_schema __pyx_string_tab[513]
#define __pyx_n_u_get_token __pyx_string_tab[514]
#define __pyx_n_u_getstate __pyx_string_tab[515]
#define __pyx_n_u_group __pyx_string_tab[516]
#define __pyx_n_u_handler __pyx_string_tab[517]
#define __pyx_n_u_headers __pyx_string_tab[518]
#define __pyx_n_u_host __pyx_string_tab[519]
#define __pyx_n_u_incoming __pyx_string_tab[520]
#define __pyx_n_u_info __pyx_string_tab[521]
#define __pyx_n_u_init __pyx_string_tab[522]
#define __pyx_n_u_instance __pyx_string_tab[523]
#define __pyx_n_u_instances __pyx_string_tab[524]
#define __pyx_n_u_is_cancelled __pyx_string_tab[525]
#define __pyx_n_u_is_coroutine __pyx_string_tab[526]
#define __pyx_n_u_is_valid __pyx_string_tab[527]
#define __pyx_n_u_items __pyx_string_tab[528]
#define __pyx_n_u_key __pyx_string_tab[529]
#define __pyx_n_u_kwargs __pyx_string_tab[530]
#define __pyx_n_u_lib __pyx_string_tab[531]
#define __pyx_n_u_limit __pyx_string_tab[532]
#define __pyx_n_u_list_actions __pyx_string_tab[533]
#define __pyx_n_u_list_flights __pyx_string_tab[534]
#define __pyx_n_u_listing __pyx_string_tab[535]
#define __pyx_n_u_localhost __pyx_string_tab[536]
#define __pyx_n_u_location __pyx_string_tab[537]
#define __pyx_n_u_locations __pyx_string_tab[538]
#define __pyx_n_u_loop __pyx_string_tab[539]
#define __pyx_n_u_lower __pyx_string_tab[540]
#define __pyx_n_u_m __pyx_string_tab[541]
#define __pyx_n_u_main __pyx_string_tab[542]
#define __pyx_n_u_make_action __pyx_string_tab[543]
#define __pyx_n_u_match __pyx_string_tab[544]
#define __pyx_n_u_max_chunksize __pyx_string_tab[545]
#define __pyx_n_u_message __pyx_string_tab[546]
#define __pyx_n_u_metaclass __pyx_string_tab[547]
#define __pyx_n_u_method __pyx_string_tab[548]
#define __pyx_n_u_middleware __pyx_string_tab[549]
#define __pyx_n_u_module __pyx_string_tab[550]
#define __pyx_n_u_more_headers __pyx_string_tab[551]
#define __pyx_n_u_mro_entries __pyx_string_tab[552]
#define __pyx_n_u_msg __pyx_string_tab[553]
#define __pyx_n_u_munge_grpc_python_error __pyx_string_tab[554]
#define __pyx_n_u_name __pyx_string_tab[555]
#define __pyx_n_u_namedtuple __pyx_string_tab[556]
#define __pyx_n_u_new __pyx_string_tab[557]
#define __pyx_n_u_next __pyx_string_tab[558]
#define __pyx_n_u_ns __pyx_string_tab[559]
#define __pyx_n_u_object __pyx_string_tab[560]
#define __pyx_n_u_options __pyx_string_tab[561]
#define __pyx_n_u_ordered __pyx_string_tab[562]
#define __pyx_n_u_other __pyx_string_tab[563]
#define __pyx_n_u_outgoing __pyx_string_tab[564]
#define __pyx_n_u_override_hostname __pyx_string_tab[565]
#define __pyx_n_u_p __pyx_string_tab[566]
#define __pyx_n_u_pair __pyx_string_tab[567]
#define __pyx_n_u_password __pyx_string_tab[568]
#define __pyx_n_u_path __pyx_string_tab[569]
#define __pyx_n_u_peer __pyx_string_tab[570]
#define __pyx_n_u_peer_identity __pyx_string_tab[571]
#define __pyx_n_u_pop __pyx_string_tab[572]
#define __pyx_n_u_port __pyx_string_tab[573]
#define __pyx_n_u_prepare __pyx_string_tab[574]
#define __pyx_n_u_private_key __pyx_string_tab[575]
#define __pyx_n_u_pw __pyx_string_tab[576]
#define __pyx_n_u_py_action __pyx_string_tab[577]
#define __pyx_n_u_py_middleware __pyx_string_tab[578]
#define __pyx_n_u_py_reader __pyx_string_tab[579]
#define __pyx_n_u_py_writer __pyx_string_tab[580]
#define __pyx_n_u_pyarrow__flight __pyx_string_tab[581]
#define __pyx_n_u_pyarrow_ipc __pyx_string_tab[582]
#define __pyx_n_u_pyarrow_lib __pyx_string_tab[583]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[584]
#define __pyx_n_u_pyx_result __pyx_string_tab[585]
#define __pyx_n_u_pyx_state __pyx_string_tab[586]
#define __pyx_n_u_pyx_type __pyx_string_tab[587]
#define __pyx_n_u_pyx_unpickle_AsyncioFlightClie __pyx_string_tab[588]
#define __pyx_n_u_pyx_unpickle_ClientAuthHandler __pyx_string_tab[589]
#define __pyx_n_u_pyx_unpickle_ClientMiddleware __pyx_string_tab[590]
#define __pyx_n_u_pyx_unpickle_ClientMiddlewareF __pyx_string_tab[591]
#define __pyx_n_u_pyx_unpickle_FlightCancelledEr __pyx_string_tab[592]
#define __pyx_n_u_pyx_unpickle_FlightDataStream __pyx_string_tab[593]
#define __pyx_n_u_pyx_unpickle_FlightError __pyx_string_tab[594]
#define __pyx_n_u_pyx_unpickle_FlightInternalErr __pyx_string_tab[595]
#define __pyx_n_u_pyx_unpickle_FlightServerError __pyx_string_tab[596]
#define __pyx_n_u_pyx_unpickle_FlightTimedOutErr __pyx_string_tab[597]
#define __pyx_n_u_pyx_unpickle_FlightUnauthentic __pyx_string_tab[598]
#define __pyx_n_u_pyx_unpickle_FlightUnauthorize __pyx_string_tab[599]
#define __pyx_n_u_pyx_unpickle_FlightUnavailable __pyx_string_tab[600]
#define __pyx_n_u_pyx_unpickle_ServerAuthHandler __pyx_string_tab[601]
#define __pyx_n_u_pyx_unpickle_ServerMiddleware __pyx_string_tab[602]
#define __pyx_n_u_pyx_unpickle_ServerMiddlewareF __pyx_string_tab[603]
#define __pyx_n_u_pyx_unpickle_TracingServerMidd __pyx_string_tab[604]
#define __pyx_n_u_pyx_unpickle__ServerMiddleware __pyx_string_tab[605]
#define __pyx_n_u_pyx_unpickle__ServerMiddleware_2 __pyx_string_tab[606]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[607]
#define __pyx_n_u_qualname __pyx_string_tab[608]
#define __pyx_n_u_re __pyx_string_tab[609]
#define __pyx_n_u_read __pyx_string_tab[610]
#define __pyx_n_u_read_all __pyx_string_tab[611]
#define __pyx_n_u_read_chunk __pyx_string_tab[612]
#define __pyx_n_u_read_options __pyx_string_tab[613]
#define __pyx_n_u_reader __pyx_string_tab[614]
#define __pyx_n_u_received_headers __pyx_string_tab[615]
#define __pyx_n_u_reduce __pyx_string_tab[616]
#define __pyx_n_u_reduce_cython __pyx_string_tab[617]
#define __pyx_n_u_reduce_ex __pyx_string_tab[618]
#define __pyx_n_u_result __pyx_string_tab[619]
#define __pyx_n_u_result_or_exception __pyx_string_tab[620]
#define __pyx_n_u_results __pyx_string_tab[621]
#define __pyx_n_u_return __pyx_string_tab[622]
#define __pyx_n_u_root_certificates __pyx_string_tab[623]
#define __pyx_n_u_run __pyx_string_tab[624]
#define __pyx_n_u_safe __pyx_string_tab[625]
#define __pyx_n_u_scalar __pyx_string_tab[626]
#define __pyx_n_u_schema __pyx_string_tab[627]
#define __pyx_n_u_self __pyx_string_tab[628]
#define __pyx_n_u_send __pyx_string_tab[629]
#define __pyx_n_u_sending_headers __pyx_string_tab[630]
#define __pyx_n_u_serialize __pyx_string_tab[631]
#define __pyx_n_u_serialized __pyx_string_tab[632]
#define __pyx_n_u_serve __pyx_string_tab[633]
#define __pyx_n_u_server __pyx_string_tab[634]
#define __pyx_n_u_set_exception __pyx_string_tab[635]
#define __pyx_n_u_set_name __pyx_string_tab[636]
#define __pyx_n_u_set_result __pyx_string_tab[637]
#define __pyx_n_u_setdefault __pyx_string_tab[638]
#define __pyx_n_u_setstate __pyx_string_tab[639]
#define __pyx_n_u_setstate_cython __pyx_string_tab[640]
#define __pyx_n_u_shutdown __pyx_string_tab[641]
#define __pyx_n_u_size __pyx_string_tab[642]
#define __pyx_n_u_sleep __pyx_string_tab[643]
#define __pyx_n_u_slots __pyx_string_tab[644]
#define __pyx_n_u_start_call __pyx_string_tab[645]
#define __pyx_n_u_state __pyx_string_tab[646]
#define __pyx_n_u_staticmethod __pyx_string_tab[647]
#define __pyx_n_u_status __pyx_string_tab[648]
#define __pyx_n_u_stop_handler __pyx_string_tab[649]
#define __pyx_n_u_stop_token __pyx_string_tab[650]
#define __pyx_n_u_super __pyx_string_tab[651]
#define __pyx_n_u_table __pyx_string_tab[652]
#define __pyx_n_u_test __pyx_string_tab[653]
#define __pyx_n_u_throw __pyx_string_tab[654]
#define __pyx_n_u_ticket __pyx_string_tab[655]
#define __pyx_n_u_time __pyx_string_tab[656]
#define __pyx_n_u_timeout __pyx_string_tab[657]
#define __pyx_n_u_timestamp __pyx_string_tab[658]
#define __pyx_n_u_tls_certificates __pyx_string_tab[659]
#define __pyx_n_u_tls_root_certs __pyx_string_tab[660]
#define __pyx_n_u_to_reader __pyx_string_tab[661]
#define __pyx_n_u_tobytes __pyx_string_tab[662]
#define __pyx_n_u_token __pyx_string_tab[663]
#define __pyx_n_u_total_bytes __pyx_string_tab[664]
#define __pyx_n_u_total_records __pyx_string_tab[665]
#define __pyx_n_u_trace_context __pyx_string_tab[666]
#define __pyx_n_u_traceback __pyx_string_tab[667]
#define __pyx_n_u_type __pyx_string_tab[668]
#define __pyx_n_u_update __pyx_string_tab[669]
#define __pyx_n_u_uri __pyx_string_tab[670]
#define __pyx_n_u_use_setstate __pyx_string_tab[671]
#define __pyx_n_u_user __pyx_string_tab[672]
#define __pyx_n_u_username __pyx_string_tab[673]
#define __pyx_n_u_value __pyx_string_tab[674]
#define __pyx_n_u_values __pyx_string_tab[675]
#define __pyx_n_u_verify_client __pyx_string_tab[676]
#define __pyx_n_u_wait __pyx_string_tab[677]
#define __pyx_n_u_wait_for_available __pyx_string_tab[678]
#define __pyx_n_u_wakeup __pyx_string_tab[679]
#define __pyx_n_u_warn __pyx_string_tab[680]
#define __pyx_n_u_warnings __pyx_string_tab[681]
#define __pyx_n_u_weakref __pyx_string_tab[682]
#define __pyx_n_u_wrapper __pyx_string_tab[683]
#define __pyx_n_u_write __pyx_string_tab[684]
#define __pyx_n_u_write_batch __pyx_string_tab[685]
#define __pyx_n_u_write_metadata __pyx_string_tab[686]
#define __pyx_n_u_write_options __pyx_string_tab[687]
#define __pyx_n_u_write_size_limit_bytes __pyx_string_tab[688]
#define __pyx_n_u_write_table __pyx_string_tab[689]
#define __pyx_n_u_write_with_metadata __pyx_string_tab[690]
#define __pyx_n_u_writer __pyx_string_tab[691]
#define __pyx_kp_b_PyObject_arrow_ipc_ReadStats_PyO __pyx_string_tab[692]
#define __pyx_kp_b__5 __pyx_string_tab[693]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[694]
#define __pyx_kp_b_iso88591_22Fa_WAQ_4z_1_LATQRRS_vR_1_q_G4 __pyx_string_tab[695]
#define __pyx_kp_b_iso88591_2_6 __pyx_string_tab[696]
#define __pyx_kp_b_iso88591_2_a __pyx_string_tab[697]
#define __pyx_kp_b_iso88591_4AV1 __pyx_string_tab[698]
#define __pyx_kp_b_iso88591_4uCr_AT_a_4uCr_aq __pyx_string_tab[699]
#define __pyx_kp_b_iso88591_5Q_1_WAQ_q_q_G4r_q_l_vQavQ_q __pyx_string_tab[700]
#define __pyx_kp_b_iso88591_5Q_q_s_F_1_1_E_q_a_q_HBk_vQd __pyx_string_tab[701]
#define __pyx_kp_b_iso88591_5QfA __pyx_string_tab[702]
#define __pyx_kp_b_iso88591_6avQ __pyx_string_tab[703]
#define __pyx_kp_b_iso88591_8_WAQ_fA_Q_Q_1_t2_6_1_Q_q_Jay_A __pyx_string_tab[704]
#define __pyx_kp_b_iso88591_8_q __pyx_string_tab[705]
#define __pyx_kp_b_iso88591_A __pyx_string_tab[706]
#define __pyx_kp_b_iso88591_AT_B_8_1 __pyx_string_tab[707]
#define __pyx_kp_b_iso88591_AV1 __pyx_string_tab[708]
#define __pyx_kp_b_iso88591_A_1A_q_G4r_q_a __pyx_string_tab[709]
#define __pyx_kp_b_iso88591_A_1_N_Q_q __pyx_string_tab[710]
#define __pyx_kp_b_iso88591_A_4q __pyx_string_tab[711]
#define __pyx_kp_b_iso88591_A_4t1_AQ_q_G5_q __pyx_string_tab[712]
#define __pyx_kp_b_iso88591_A_4t1_AQ_q_G6 __pyx_string_tab[713]
#define __pyx_kp_b_iso88591_A_4wd_S_AQ_q_G4r __pyx_string_tab[714]
#define __pyx_kp_b_iso88591_A_4wd_S_AQ_q_G4r1B __pyx_string_tab[715]
#define __pyx_kp_b_iso88591_A_7q_q_G4r_b_aq_Q_5_fCuD_V_A_q __pyx_string_tab[716]
#define __pyx_kp_b_iso88591_A_A_E_D_wk_q_1_aq_1_q __pyx_string_tab[717]
#define __pyx_kp_b_iso88591_A_D_t3gQ __pyx_string_tab[718]
#define __pyx_kp_b_iso88591_A_F __pyx_string_tab[719]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_1_Qg_q_1_Qg __pyx_string_tab[720]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_2_awk_PQ_2 __pyx_string_tab[721]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_4D_7RS_4D_1 __pyx_string_tab[722]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_4q_RYYZ_4q __pyx_string_tab[723]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_5T_GST_5T_A __pyx_string_tab[724]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_7t1G_gUV_7t __pyx_string_tab[725]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_8_AWKwVW_8 __pyx_string_tab[726]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_D_7_D_1 __pyx_string_tab[727]
#define __pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_t1G_V_t1G_V __pyx_string_tab[728]
#define __pyx_kp_b_iso88591_A_HAQ_a_q __pyx_string_tab[729]
#define __pyx_kp_b_iso88591_A_HAQ_k_k_T_a_q __pyx_string_tab[730]
#define __pyx_kp_b_iso88591_A_HAQ_k_k_q_q __pyx_string_tab[731]
#define __pyx_kp_b_iso88591_A_HJawavWAQ __pyx_string_tab[732]
#define __pyx_kp_b_iso88591_A_HKq_q_gQa __pyx_string_tab[733]
#define __pyx_kp_b_iso88591_A_HN_1_1_4x_QgQa_1_1_c_A_0_7z_1 __pyx_string_tab[734]
#define __pyx_kp_b_iso88591_A_L_Kwa_8_31_t1_Z_6_c_q_Qiwa_a_q __pyx_string_tab[735]
#define __pyx_kp_b_iso88591_A_L_Kwa_O1A __pyx_string_tab[736]
#define __pyx_kp_b_iso88591_A_Q __pyx_string_tab[737]
#define __pyx_kp_b_iso88591_A_Qa_F __pyx_string_tab[738]
#define __pyx_kp_b_iso88591_A_Qd_1 __pyx_string_tab[739]
#define __pyx_kp_b_iso88591_A_Qd_Q __pyx_string_tab[740]
#define __pyx_kp_b_iso88591_A_Qd_R_A __pyx_string_tab[741]
#define __pyx_kp_b_iso88591_A_Qd_T_3EQ __pyx_string_tab[742]
#define __pyx_kp_b_iso88591_A_Qd_q __pyx_string_tab[743]
#define __pyx_kp_b_iso88591_A_Qd_t2_q __pyx_string_tab[744]
#define __pyx_kp_b_iso88591_A_Qha_q_HBfAZq __pyx_string_tab[745]
#define __pyx_kp_b_iso88591_A_Ry_IQ_Ja __pyx_string_tab[746]
#define __pyx_kp_b_iso88591_A_T_A_7_Q_y_6_A_V5_q_vQ __pyx_string_tab[747]
#define __pyx_kp_b_iso88591_A_V81A_gV1_QnA_QgQa_q __pyx_string_tab[748]
#define __pyx_kp_b_iso88591_A_V81A_j_a_q_q_q __pyx_string_tab[749]
#define __pyx_kp_b_iso88591_A_V81A_l_q_q_q __pyx_string_tab[750]
#define __pyx_kp_b_iso88591_A_WAQ_q_q_G4r_q_a_q_a_a_gXQ_a_g __pyx_string_tab[751]
#define __pyx_kp_b_iso88591_A_WD_7_Q_q_fA __pyx_string_tab[752]
#define __pyx_kp_b_iso88591_A_XQa_N_q_q_q __pyx_string_tab[753]
#define __pyx_kp_b_iso88591_A_a __pyx_string_tab[754]
#define __pyx_kp_b_iso88591_A_a_2 __pyx_string_tab[755]
#define __pyx_kp_b_iso88591_A_a_3 __pyx_string_tab[756]
#define __pyx_kp_b_iso88591_A_a_4 __pyx_string_tab[757]
#define __pyx_kp_b_iso88591_A_a_5 __pyx_string_tab[758]
#define __pyx_kp_b_iso88591_A_a_6 __pyx_string_tab[759]
#define __pyx_kp_b_iso88591_A_a_7 __pyx_string_tab[760]
#define __pyx_kp_b_iso88591_A_a_8 __pyx_string_tab[761]
#define __pyx_kp_b_iso88591_A_a_WAQ_G1A_T_B_QfA_DA_q_gQ_Qa __pyx_string_tab[762]
#define __pyx_kp_b_iso88591_A_ay_q_HB_0_uIQ __pyx_string_tab[763]
#define __pyx_kp_b_iso88591_A_ay_q_HBnAQ __pyx_string_tab[764]
#define __pyx_kp_b_iso88591_A_fA_l_a_1_D_t1_V1AQ __pyx_string_tab[765]
#define __pyx_kp_b_iso88591_A_gQa_hhaq_1_aq_a_q __pyx_string_tab[766]
#define __pyx_kp_b_iso88591_A_gQa_hhaq_q_q_q __pyx_string_tab[767]
#define __pyx_kp_b_iso88591_A_q __pyx_string_tab[768]
#define __pyx_kp_b_iso88591_A_q_4A_Qa_1_oQ_q_a __pyx_string_tab[769]
#define __pyx_kp_b_iso88591_A_q_G4r_6_1 __pyx_string_tab[770]
#define __pyx_kp_b_iso88591_A_q_G4r_aq_4s_1_1 __pyx_string_tab[771]
#define __pyx_kp_b_iso88591_A_q_G4s_a __pyx_string_tab[772]
#define __pyx_kp_b_iso88591_A_q_HB_q_e9A __pyx_string_tab[773]
#define __pyx_kp_b_iso88591_A_q_HBfA __pyx_string_tab[774]
#define __pyx_kp_b_iso88591_A_t2U __pyx_string_tab[775]
#define __pyx_kp_b_iso88591_A_t8 __pyx_string_tab[776]
#define __pyx_kp_b_iso88591_A_uCq __pyx_string_tab[777]
#define __pyx_kp_b_iso88591_A_vQd __pyx_string_tab[778]
#define __pyx_kp_b_iso88591_A_wat8 __pyx_string_tab[779]
#define __pyx_kp_b_iso88591_A_xq_gV1_QnA_QgQa_q __pyx_string_tab[780]
#define __pyx_kp_b_iso88591_A_y_KvQnA_1_7_1_q __pyx_string_tab[781]
#define __pyx_kp_b_iso88591_A_y_XU_e1 __pyx_string_tab[782]
#define __pyx_kp_b_iso88591_A_z_HD_q_1G1A_q __pyx_string_tab[783]
#define __pyx_kp_b_iso88591_B_WAQ_q_G4r_q_fJfAQa_1_gV1F_q __pyx_string_tab[784]
#define __pyx_kp_b_iso88591_H_q_A __pyx_string_tab[785]
#define __pyx_kp_b_iso88591_Kw_r_q __pyx_string_tab[786]
#define __pyx_kp_b_iso88591_Q __pyx_string_tab[787]
#define __pyx_kp_b_iso88591_Q_0_haq_WAQ_q_G4q_av_fAQfA_q __pyx_string_tab[788]
#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[789]
#define __pyx_kp_b_iso88591_Q_WAQ_QiuA_V1HA_q_V2Q_1HA_1A_gQ __pyx_string_tab[790]
#define __pyx_kp_b_iso88591_Q_t89A_Q_1_Q_H_A_Q_HM __pyx_string_tab[791]
#define __pyx_kp_b_iso88591_QfA __pyx_string_tab[792]
#define __pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t9G1_q_4D_7RS_4 __pyx_string_tab[793]
#define __pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t_gQ_q_AWKW___A __pyx_string_tab[794]
#define __pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t_wa_q_9_Qg_PWW __pyx_string_tab[795]
#define __pyx_kp_b_iso88591_XQ_2 __pyx_string_tab[796]
#define __pyx_kp_b_iso88591__10 __pyx_string_tab[797]
#define __pyx_kp_b_iso88591__11 __pyx_string_tab[798]
#define __pyx_kp_b_iso88591_a_1_WAQ_q_q_G4r_A_a_V1AQ_a_a_37 __pyx_string_tab[799]
#define __pyx_kp_b_iso88591_a_t1 __pyx_string_tab[800]
#define __pyx_kp_b_iso88591_avQ __pyx_string_tab[801]
#define __pyx_kp_b_iso88591_q_0_kQR_1_7_9_TTbbc_1 __pyx_string_tab[802]
#define __pyx_kp_b_iso88591_q_0_kQR_1_7_Abbppq_1 __pyx_string_tab[803]
#define __pyx_kp_b_iso88591_q_0_kQR_2_1_7_A_Bddrrs_1 __pyx_string_tab[804]
#define __pyx_kp_b_iso88591_q_0_kQR_7_8_9RR_a_1 __pyx_string_tab[805]
#define __pyx_kp_b_iso88591_q_0_kQR_81A_7_2_3FnTU_1 __pyx_string_tab[806]
#define __pyx_kp_b_iso88591_q_0_kQR_81A_7_VVdde_1 __pyx_string_tab[807]
#define __pyx_kp_b_iso88591_q_0_kQR_HAQ_7_314H_VW_1 __pyx_string_tab[808]
#define __pyx_kp_b_iso88591_q_0_kQR_XQa_7_A_ZZhhi_1 __pyx_string_tab[809]
#define __pyx_kp_b_iso88591_q_0_kQR_haq_7_5Q6LNZ_1 __pyx_string_tab[810]
#define __pyx_kp_b_iso88591_q_0_kQR_haq_7_QnN_1 __pyx_string_tab[811]
#define __pyx_kp_b_iso88591_q_0_kQR_xq_7_6a7Nn_1 __pyx_string_tab[812]
#define __pyx_kp_b_iso88591_q_1F_5_PQQR_q __pyx_string_tab[813]
#define __pyx_kp_b_iso88591_q_a __pyx_string_tab[814]
#define __pyx_float_0_025 __pyx_number_tab[0]
#define __pyx_int_0 __pyx_number_tab[1]
#define __pyx_int_1 __pyx_number_tab[2]
#define __pyx_int_2 __pyx_number_tab[3]
#define __pyx_int_3 __pyx_number_tab[4]
#define __pyx_int_4 __pyx_number_tab[5]
#define __pyx_int_5 __pyx_number_tab[6]
#define __pyx_int_6 __pyx_number_tab[7]
#define __pyx_int_7 __pyx_number_tab[8]
#define __pyx_int_8 __pyx_number_tab[9]
#define __pyx_int_9 __pyx_number_tab[10]
#define __pyx_int_137192776 __pyx_number_tab[11]
#define __pyx_int_235806214 __pyx_number_tab[12]
#define __pyx_int_238750788 __pyx_number_tab[13]
#define __pyx_int_265810548 __pyx_number_tab[14]
/* #### 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);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Weakrefable);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IpcReadOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Message);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MemoryPool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DataType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListViewType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MapType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StructType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryMemo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_TimestampType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Time32Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Time64Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DurationType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BaseExtensionType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Bool8Type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_OpaqueType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UuidType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_JsonType);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Metadata);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Field);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Schema);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Scalar);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ArrayStatistics);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__PandasConvertible);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Tensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NullArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BooleanArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NumericArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_IntegerArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FloatingPointArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int8Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt8Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int16Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt16Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Int64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UInt64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_HalfFloatArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FloatArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DoubleArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Array);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StructArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BaseListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ListViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MapArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_UnionArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StringArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BinaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StringViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BinaryViewArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ChunkedArray);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__Tabular);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Table);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatch);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Device);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_MemoryManager);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Buffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_ResizableBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_NativeFile);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BufferedInputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CompressedInputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_CacheOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_Codec);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_3lib_StopToken);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightCallOptions);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightInternalError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightInternalError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightTimedOutError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightCancelledError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightServerError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightServerError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightUnavailableError);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_Action);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_Action);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_Result);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_Result);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_BasicAuth);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_BasicAuth);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightDescriptor);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_Ticket);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_Ticket);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_Location);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_Location);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightEndpoint);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_SchemaResult);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_SchemaResult);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightInfo);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightInfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamChunk);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightMetadataReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightMetadataWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_AsyncioFlightClient);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightClient);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightClient);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightDataStream);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightDataStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_RecordBatchStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_GeneratorStream);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_GeneratorStream);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerCallContext);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerCallContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthSender);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthSender);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthHandler);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthHandler);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ClientMiddleware);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_ServerMiddleware);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight__FlightServerFinalizer);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight_FlightServerBase);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight_FlightServerBase);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response);
  Py_CLEAR(clear_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights);
  Py_CLEAR(clear_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights);
  for (int i=0; i<9; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<214; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<815; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<15; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* Coroutine.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CoroutineType);
Py_CLEAR(clear_module_state->__pyx_CoroutineAwaitType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* Generator.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_clear_end ### */
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);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Weakrefable);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IpcReadOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Message);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MemoryPool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DataType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListViewType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MapType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StructType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryMemo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_TimestampType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Time32Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Time64Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DurationType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BaseExtensionType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Bool8Type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_OpaqueType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UuidType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_JsonType);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Metadata);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Field);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Schema);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Scalar);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ArrayStatistics);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__PandasConvertible);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Tensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NullArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BooleanArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NumericArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_IntegerArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FloatingPointArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int8Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt8Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int16Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt16Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Int64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UInt64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_HalfFloatArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FloatArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DoubleArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal32Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal64Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal128Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Decimal256Array);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StructArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BaseListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ListViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_LargeListViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MapArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_UnionArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StringArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BinaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StringViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BinaryViewArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_DictionaryArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ExtensionArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ChunkedArray);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__Tabular);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Table);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatch);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Device);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_MemoryManager);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Buffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_ResizableBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_NativeFile);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BufferedInputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CompressedInputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_RecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_CacheOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_Codec);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_3lib_StopToken);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightCallOptions);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightInternalError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightInternalError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightTimedOutError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightCancelledError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightServerError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightServerError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightUnavailableError);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_Action);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_Action);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_Result);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_Result);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_BasicAuth);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_BasicAuth);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightDescriptor);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_Ticket);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_Ticket);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_Location);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_Location);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightEndpoint);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_SchemaResult);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_SchemaResult);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightInfo);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightInfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamChunk);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightStreamWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightMetadataReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightMetadataWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_AsyncioFlightClient);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightClient);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightClient);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightDataStream);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightDataStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_RecordBatchStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_GeneratorStream);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_GeneratorStream);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerCallContext);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerCallContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthSender);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthSender);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerAuthHandler);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ClientAuthHandler);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ClientMiddleware);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_ServerMiddleware);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight__FlightServerFinalizer);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight_FlightServerBase);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight_FlightServerBase);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response);
  Py_VISIT(traverse_module_state->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights);
  Py_VISIT(traverse_module_state->__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights);
  for (int i=0; i<9; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<214; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<815; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<15; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* Coroutine.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CoroutineType);
Py_VISIT(traverse_module_state->__pyx_CoroutineAwaitType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* Generator.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_GeneratorType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "string.to_py":31
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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":33
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":34
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 34, __pyx_L1_error)

    /* "string.to_py":33
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":35
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":31
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":39
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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":41
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":42
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 42, __pyx_L1_error)

    /* "string.to_py":41
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":43
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":39
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":47
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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":49
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":50
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
 * cdef extern from *:
*/
    PyErr_NoMemory(); __PYX_ERR(1, 50, __pyx_L1_error)

    /* "string.to_py":49
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":51
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
 * cdef extern from *:
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":47
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":55
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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
  int __pyx_t_1;
  PyObject *__pyx_t_2 = 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":57
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  __pyx_t_1 = (__pyx_v_s.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "string.to_py":58
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
    PyErr_NoMemory(); __PYX_ERR(1, 58, __pyx_L1_error)

    /* "string.to_py":57
 * @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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())
*/
  }

  /* "string.to_py":59
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), <Py_ssize_t> s.size())             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), ((Py_ssize_t)__pyx_v_s.size())); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "string.to_py":55
 *     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):
 *     if s.size() > <size_t> PY_SSIZE_T_MAX:
*/

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

/* "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, <size_t> 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, <size_t> length)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, <size_t> length)             # <<<<<<<<<<<<<<
 * 
*/
  try {
    __pyx_t_2 = std::string(__pyx_v_data, ((size_t)__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;
}

/* "pair.from_py":190
 *         pair(T&, U&) except +
 * 
 * @cname("__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string")             # <<<<<<<<<<<<<<
 * cdef pair[X,Y] __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     x, y = o
*/

static std::pair<std::string,std::string>  __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  std::pair<std::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)(PyObject *);
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  std::pair<std::string,std::string>  __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);

  /* "pair.from_py":192
 * @cname("__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string")
 * cdef pair[X,Y] __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     x, y = o             # <<<<<<<<<<<<<<
 *     return pair[X,Y](<X>x, <Y>y)
 * 
*/
  if ((likely(PyTuple_CheckExact(__pyx_v_o))) || (PyList_CheckExact(__pyx_v_o))) {
    PyObject* sequence = __pyx_v_o;
    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(1, 192, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3);
    index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < (0)) __PYX_ERR(1, 192, __pyx_L1_error)
    __pyx_t_4 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(1, 192, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pair.from_py":193
 * cdef pair[X,Y] __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     x, y = o
 *     return pair[X,Y](<X>x, <Y>y)             # <<<<<<<<<<<<<<
 * 
*/
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_x); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_y); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
  try {
    __pyx_t_7 = std::pair<std::string,std::string> (((std::string)__pyx_t_5), ((std::string)__pyx_t_6));
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 193, __pyx_L1_error)
  }
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "pair.from_py":190
 *         pair(T&, U&) except +
 * 
 * @cname("__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string")             # <<<<<<<<<<<<<<
 * cdef pair[X,Y] __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
 *     x, y = o
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pair.from_py.__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pair.to_py":203
 *         U second
 * 
 * @cname("__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string")             # <<<<<<<<<<<<<<
 * cdef object __pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(const pair[X,Y]& p):
 *     return p.first, p.second
*/

static PyObject *__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(std::pair<std::string,std::string>  const &__pyx_v_p) {
  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("__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string", 0);

  /* "pair.to_py":205
 * @cname("__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string")
 * cdef object __pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(const pair[X,Y]& p):
 *     return p.first, p.second             # <<<<<<<<<<<<<<
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(1, 205, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(1, 205, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pair.to_py":203
 *         U second
 * 
 * @cname("__pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string")             # <<<<<<<<<<<<<<
 * cdef object __pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(const pair[X,Y]& p):
 *     return p.first, p.second
*/

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

/* "vector.to_py":79
 *     const Py_ssize_t PY_SSIZE_T_MAX
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")             # <<<<<<<<<<<<<<
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
*/

static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(std::vector<std::pair<std::string,std::string> >  const &__pyx_v_v) {
  Py_ssize_t __pyx_v_v_size_signed;
  PyObject *__pyx_v_o = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);

  /* "vector.to_py":81
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()
*/
  __pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "vector.to_py":82
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     v_size_signed = <Py_ssize_t> v.size()
 * 
*/
    PyErr_NoMemory(); __PYX_ERR(1, 82, __pyx_L1_error)

    /* "vector.to_py":81
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()
*/
  }

  /* "vector.to_py":83
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()             # <<<<<<<<<<<<<<
 * 
 *     o = PyList_New(v_size_signed)
*/
  __pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());

  /* "vector.to_py":85
 *     v_size_signed = <Py_ssize_t> v.size()
 * 
 *     o = PyList_New(v_size_signed)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
*/
  __pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_o = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "vector.to_py":90
 *     cdef object item
 * 
 *     for i in range(v_size_signed):             # <<<<<<<<<<<<<<
 *         item = v[i]
 *         Py_INCREF(item)
*/
  __pyx_t_3 = __pyx_v_v_size_signed;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "vector.to_py":91
 * 
 *     for i in range(v_size_signed):
 *         item = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(item)
 *         __Pyx_PyList_SET_ITEM(o, i, item)
*/
    __pyx_t_2 = __pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "vector.to_py":92
 *     for i in range(v_size_signed):
 *         item = v[i]
 *         Py_INCREF(item)             # <<<<<<<<<<<<<<
 *         __Pyx_PyList_SET_ITEM(o, i, item)
 * 
*/
    Py_INCREF(__pyx_v_item);

    /* "vector.to_py":93
 *         item = v[i]
 *         Py_INCREF(item)
 *         __Pyx_PyList_SET_ITEM(o, i, item)             # <<<<<<<<<<<<<<
 * 
 *     return o
*/
    __pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 93, __pyx_L1_error)
  }

  /* "vector.to_py":95
 *         __Pyx_PyList_SET_ITEM(o, i, item)
 * 
 *     return o             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "vector.to_py":79
 *     const Py_ssize_t PY_SSIZE_T_MAX
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")             # <<<<<<<<<<<<<<
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(std::vector<std::string>  const &__pyx_v_v) {
  Py_ssize_t __pyx_v_v_size_signed;
  PyObject *__pyx_v_o = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_string", 0);

  /* "vector.to_py":81
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()
*/
  __pyx_t_1 = (__pyx_v_v.size() > ((size_t)PY_SSIZE_T_MAX));
  if (unlikely(__pyx_t_1)) {

    /* "vector.to_py":82
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()             # <<<<<<<<<<<<<<
 *     v_size_signed = <Py_ssize_t> v.size()
 * 
*/
    PyErr_NoMemory(); __PYX_ERR(1, 82, __pyx_L1_error)

    /* "vector.to_py":81
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:             # <<<<<<<<<<<<<<
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()
*/
  }

  /* "vector.to_py":83
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
 *         raise MemoryError()
 *     v_size_signed = <Py_ssize_t> v.size()             # <<<<<<<<<<<<<<
 * 
 *     o = PyList_New(v_size_signed)
*/
  __pyx_v_v_size_signed = ((Py_ssize_t)__pyx_v_v.size());

  /* "vector.to_py":85
 *     v_size_signed = <Py_ssize_t> v.size()
 * 
 *     o = PyList_New(v_size_signed)             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t i
*/
  __pyx_t_2 = PyList_New(__pyx_v_v_size_signed); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_o = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "vector.to_py":90
 *     cdef object item
 * 
 *     for i in range(v_size_signed):             # <<<<<<<<<<<<<<
 *         item = v[i]
 *         Py_INCREF(item)
*/
  __pyx_t_3 = __pyx_v_v_size_signed;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "vector.to_py":91
 * 
 *     for i in range(v_size_signed):
 *         item = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(item)
 *         __Pyx_PyList_SET_ITEM(o, i, item)
*/
    __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "vector.to_py":92
 *     for i in range(v_size_signed):
 *         item = v[i]
 *         Py_INCREF(item)             # <<<<<<<<<<<<<<
 *         __Pyx_PyList_SET_ITEM(o, i, item)
 * 
*/
    Py_INCREF(__pyx_v_item);

    /* "vector.to_py":93
 *         item = v[i]
 *         Py_INCREF(item)
 *         __Pyx_PyList_SET_ITEM(o, i, item)             # <<<<<<<<<<<<<<
 * 
 *     return o
*/
    __pyx_t_6 = __Pyx_PyList_SET_ITEM(__pyx_v_o, __pyx_v_i, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 93, __pyx_L1_error)
  }

  /* "vector.to_py":95
 *         __Pyx_PyList_SET_ITEM(o, i, item)
 * 
 *     return o             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "vector.to_py":79
 *     const Py_ssize_t PY_SSIZE_T_MAX
 * 
 * @cname("__pyx_convert_vector_to_py_std_3a__3a_string")             # <<<<<<<<<<<<<<
 * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(const vector[X]& v):
 *     if v.size() > <size_t> PY_SSIZE_T_MAX:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")             # <<<<<<<<<<<<<<
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *:
 * 
*/

static std::vector<std::pair<std::string,std::string> >  __pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(PyObject *__pyx_v_o) {
  std::vector<std::pair<std::string,std::string> >  __pyx_v_v;
  Py_ssize_t __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::pair<std::string,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::pair<std::string,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_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);

  /* "vector.from_py":55
 * 
 *     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)-1L))) __PYX_ERR(1, 55, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "vector.from_py":57
 *     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":58
 * 
 *     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, 58, __pyx_L1_error)
    }

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

  /* "vector.from_py":60
 *         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, 60, __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, 60, __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, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__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, 60, __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, 60, __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, 60, __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":61
 * 
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 * 
 *     return v
*/
    __pyx_t_6 = __pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
    try {
      __pyx_v_v.push_back(((std::pair<std::string,std::string> )__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 61, __pyx_L1_error)
    }

    /* "vector.from_py":60
 *         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":63
 *         v.push_back(<X>item)
 * 
 *     return v             # <<<<<<<<<<<<<<
 * 
*/
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":51
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")             # <<<<<<<<<<<<<<
 * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(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_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *__pyx_v_o) {
  std::vector<std::string>  __pyx_v_v;
  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":55
 * 
 *     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)-1L))) __PYX_ERR(1, 55, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "vector.from_py":57
 *     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":58
 * 
 *     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, 58, __pyx_L1_error)
    }

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

  /* "vector.from_py":60
 *         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, 60, __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, 60, __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, 60, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__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, 60, __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, 60, __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, 60, __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":61
 * 
 *     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, 61, __pyx_L1_error)
    try {
      __pyx_v_v.push_back(((std::string)__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 61, __pyx_L1_error)
    }

    /* "vector.from_py":60
 *         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":63
 *         v.push_back(<X>item)
 * 
 *     return v             # <<<<<<<<<<<<<<
 * 
*/
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":51
 *     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;
}

/* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":23
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         # unavailable in limited API
*/
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":20
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double real(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

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

  /* "cpython/complex.pxd":26
 * 
 *         # unavailable in limited API
 *         @property             # <<<<<<<<<<<<<<
 *         @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 *         cdef inline double imag(self) noexcept:
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}
#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/

/* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":116
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

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

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

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

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

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

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

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

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

  /* "cpython/contextvars.pxd":115
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

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

/* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

#if !CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {

  /* "cpython/contextvars.pxd":134
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
*/
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

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

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

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

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

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

  /* "cpython/contextvars.pxd":133
 * 
 * 
 * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API")             # <<<<<<<<<<<<<<
 * cdef inline object get_value_no_default(var, default_value=None):
 *     """Return a new reference to the value of the context variable,
*/

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

/* "cpython/datetime.pxd":44
 * 
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":46
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":44
 * 
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

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

/* "cpython/datetime.pxd":48
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":50
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":48
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

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

/* "cpython/datetime.pxd":52
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":54
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
*/
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":52
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

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

/* "cpython/datetime.pxd":57
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":59
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":57
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)
*/

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

/* "cpython/datetime.pxd":61
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":63
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":61
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)
*/

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

/* "cpython/datetime.pxd":65
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":67
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":65
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)
*/

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

/* "cpython/datetime.pxd":69
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":71
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":69
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
*/

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

/* "cpython/datetime.pxd":73
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 0);

  /* "cpython/datetime.pxd":75
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":73
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
*/

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

/* "cpython/datetime.pxd":77
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":80
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
*/
  __pyx_r = PyDateTime_TIME_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":77
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

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

/* "cpython/datetime.pxd":83
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":85
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":83
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)
*/

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

/* "cpython/datetime.pxd":87
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":89
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":87
 *             return PyDateTime_GET_YEAR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)
*/

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

/* "cpython/datetime.pxd":91
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":93
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":91
 *             return PyDateTime_GET_MONTH(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)
*/

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

/* "cpython/datetime.pxd":95
 *             return PyDateTime_GET_DAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":97
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":95
 *             return PyDateTime_GET_DAY(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)
*/

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

/* "cpython/datetime.pxd":99
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":101
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":99
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)
*/

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

/* "cpython/datetime.pxd":103
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":105
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":103
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)
*/

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

/* "cpython/datetime.pxd":107
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":109
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":107
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
*/

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

/* "cpython/datetime.pxd":111
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 0);

  /* "cpython/datetime.pxd":113
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":111
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
*/

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

/* "cpython/datetime.pxd":115
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":118
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
*/
  __pyx_r = PyDateTime_DATE_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":115
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
*/

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

/* "cpython/datetime.pxd":121
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":123
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":121
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)
*/

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

/* "cpython/datetime.pxd":125
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":127
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
*/
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":125
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)
*/

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

/* "cpython/datetime.pxd":129
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":131
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.tzinfo[object PyDateTime_TZInfo]:
*/
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":129
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 *         @property             # <<<<<<<<<<<<<<
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
*/

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

/* "cpython/datetime.pxd":255
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
*/

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {

  /* "cpython/datetime.pxd":256
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
*/
  (void)(PyDateTime_IMPORT);

  /* "cpython/datetime.pxd":255
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
*/

  /* function exit code */
}

/* "cpython/datetime.pxd":260
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
*/

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_new", 0);

  /* "cpython/datetime.pxd":261
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":260
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
*/

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

/* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":266
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_TimeWithFold(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(3, 266, __pyx_L1_error)
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":265
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
*/

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

/* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":271
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_DateTimeWithFold(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":270
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
*/

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

/* "cpython/datetime.pxd":275
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
*/

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyDateTime_Delta *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timedelta_new", 0);

  /* "cpython/datetime.pxd":276
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":275
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
*/

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

/* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *__pyx_v_offset, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args) {
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__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("timezone_new", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_name = __pyx_optional_args->name;
    }
  }

  /* "cpython/datetime.pxd":280
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DB API constructor.
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_name != Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = ((PyObject *)__pyx_v_name);
  } else {
    __pyx_t_1 = NULL;
  }
  __pyx_t_3 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":279
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
*/

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

/* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *__pyx_v_timestamp, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_from_timestamp", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cpython/datetime.pxd":284
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cpython/datetime.pxd":285
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DB API constructor.
*/
  __pyx_t_2 = (__pyx_v_tz != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tz);
    __Pyx_GIVEREF(__pyx_v_tz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tz) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 285, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "cpython/datetime.pxd":284
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
*/
  __pyx_t_3 = ((PyObject *)PyDateTimeAPI->DateTime_FromTimestamp(((PyObject *)PyDateTimeAPI->DateTimeType), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":283
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/

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

/* "cpython/datetime.pxd":288
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
*/

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *__pyx_v_timestamp) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_from_timestamp", 0);

  /* "cpython/datetime.pxd":289
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_timestamp);
  __Pyx_GIVEREF(__pyx_v_timestamp);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_timestamp) != (0)) __PYX_ERR(3, 289, __pyx_L1_error);
  __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":288
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
*/

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

/* "cpython/datetime.pxd":297
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_utc", 0);

  /* "cpython/datetime.pxd":298
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     return <object>__Pyx_TimeZone_UTC             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of time
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__Pyx_TimeZone_UTC));
  __pyx_r = ((PyObject *)__Pyx_TimeZone_UTC);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":297
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
*/

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

/* "cpython/datetime.pxd":301
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 0);

  /* "cpython/datetime.pxd":302
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":301
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
*/

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

/* "cpython/datetime.pxd":305
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
*/

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 0);

  /* "cpython/datetime.pxd":306
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":305
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
*/

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

/* "cpython/datetime.pxd":309
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":310
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
*/
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":309
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

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

/* "cpython/datetime.pxd":313
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":314
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
*/
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":313
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

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

/* "cpython/datetime.pxd":317
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":318
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
*/
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":317
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

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

/* "cpython/datetime.pxd":321
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":322
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
*/
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":321
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
*/

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

/* "cpython/datetime.pxd":325
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":326
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
*/
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":325
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
*/

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

/* "cpython/datetime.pxd":329
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":330
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
*/
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":329
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
*/

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

/* "cpython/datetime.pxd":333
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":334
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
*/
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":333
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
*/

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

/* "cpython/datetime.pxd":337
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":338
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
*/
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":337
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
*/

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

/* "cpython/datetime.pxd":341
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":342
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
*/
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":341
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
*/

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

/* "cpython/datetime.pxd":345
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":346
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of time
*/
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":345
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
*/

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

/* "cpython/datetime.pxd":349
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":351
 * cdef inline int time_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
*/
  __pyx_r = PyDateTime_TIME_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":349
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
*/

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

/* "cpython/datetime.pxd":354
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":355
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":354
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
*/

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

/* "cpython/datetime.pxd":358
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":359
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":358
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
*/

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

/* "cpython/datetime.pxd":362
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":363
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":362
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
*/

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

/* "cpython/datetime.pxd":366
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":367
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of datetime
*/
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":366
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
*/

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

/* "cpython/datetime.pxd":370
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":372
 * cdef inline int datetime_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
*/
  __pyx_r = PyDateTime_DATE_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":370
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
*/

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

/* "cpython/datetime.pxd":375
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_DAYS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":376
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:
 *     return PyDateTime_DELTA_GET_DAYS(o)             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
*/
  __pyx_r = PyDateTime_DELTA_GET_DAYS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":375
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_DAYS(o)
 * 
*/

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

/* "cpython/datetime.pxd":379
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_SECONDS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":380
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:
 *     return PyDateTime_DELTA_GET_SECONDS(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
*/
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":379
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_SECONDS(o)
 * 
*/

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

/* "cpython/datetime.pxd":383
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
*/

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":384
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)             # <<<<<<<<<<<<<<
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:
*/
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":383
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
*/

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

/* "cpython/datetime.pxd":386
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
*/

static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *__pyx_v_obj) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_micros;
  double __pyx_r;

  /* "cpython/datetime.pxd":392
 *     cdef:
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)             # <<<<<<<<<<<<<<
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
*/
  __pyx_v_days = ((double)PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":393
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)             # <<<<<<<<<<<<<<
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
*/
  __pyx_v_seconds = ((double)PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":394
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)             # <<<<<<<<<<<<<<
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
*/
  __pyx_v_micros = ((double)PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":395
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000             # <<<<<<<<<<<<<<
*/
  __pyx_r = ((((__pyx_v_days * 24.0) * 3600.0) + __pyx_v_seconds) + (__pyx_v_micros / 1000000.0));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":386
 *     return PyDateTime_DELTA_GET_MICROSECONDS(o)
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
*/

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

/* "pyarrow/includes/common.pxd":151
 * 
 * 
 * cdef inline object PyObject_to_object(PyObject* o):             # <<<<<<<<<<<<<<
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
*/

static CYTHON_INLINE PyObject *__pyx_f_7pyarrow_8includes_6common_PyObject_to_object(PyObject *__pyx_v_o) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("PyObject_to_object", 0);

  /* "pyarrow/includes/common.pxd":153
 * cdef inline object PyObject_to_object(PyObject* o):
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o             # <<<<<<<<<<<<<<
 *     cpython.Py_DECREF(result)
 *     return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_o);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/includes/common.pxd":154
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
 *     cpython.Py_DECREF(result)             # <<<<<<<<<<<<<<
 *     return result
*/
  Py_DECREF(__pyx_v_result);

  /* "pyarrow/includes/common.pxd":155
 *     cdef object result = <object> o
 *     cpython.Py_DECREF(result)
 *     return result             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/includes/common.pxd":151
 * 
 * 
 * cdef inline object PyObject_to_object(PyObject* o):             # <<<<<<<<<<<<<<
 *     # Cast to "object" increments reference count
 *     cdef object result = <object> o
*/

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

/* "pyarrow/_flight.pyx":43
 * 
 * 
 * cdef int check_flight_status(const CStatus& status) except -1 nogil:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[FlightStatusDetail] detail
 * 
*/

static int __pyx_f_7pyarrow_7_flight_check_flight_status(arrow::Status const &__pyx_v_status) {
  std::shared_ptr< arrow::flight::FlightStatusDetail>  __pyx_v_detail;
  PyObject *__pyx_v_message = NULL;
  std::string __pyx_v_detail_msg;
  std::shared_ptr< arrow::flight::FlightWriteSizeStatusDetail>  __pyx_v_size_detail;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  bool __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;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;
  __Pyx_RefNannySetupContext("check_flight_status", 1);

  /* "pyarrow/_flight.pyx":46
 *     cdef shared_ptr[FlightStatusDetail] detail
 * 
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
*/
  __pyx_t_1 = (__pyx_v_status.ok() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":47
 * 
 *     if status.ok():
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     detail = FlightStatusDetail.UnwrapStatus(status)
*/
    __pyx_r = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":46
 *     cdef shared_ptr[FlightStatusDetail] detail
 * 
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
*/
  }

  /* "pyarrow/_flight.pyx":49
 *         return 0
 * 
 *     detail = FlightStatusDetail.UnwrapStatus(status)             # <<<<<<<<<<<<<<
 *     if detail:
 *         with gil:
*/
  __pyx_v_detail =  arrow::flight::FlightStatusDetail::UnwrapStatus(__pyx_v_status);

  /* "pyarrow/_flight.pyx":50
 * 
 *     detail = FlightStatusDetail.UnwrapStatus(status)
 *     if detail:             # <<<<<<<<<<<<<<
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
*/
  __pyx_t_2 = __pyx_v_detail.operator bool();
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":51
 *     detail = FlightStatusDetail.UnwrapStatus(status)
 *     if detail:
 *         with gil:             # <<<<<<<<<<<<<<
 *             message = frombytes(status.message(), safe=True)
 *             detail_msg = detail.get().extra_info()
*/
    {
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        /*try:*/ {

          /* "pyarrow/_flight.pyx":52
 *     if detail:
 *         with gil:
 *             message = frombytes(status.message(), safe=True)             # <<<<<<<<<<<<<<
 *             detail_msg = detail.get().extra_info()
 *             if detail.get().code() == CFlightStatusInternal:
*/
          __pyx_t_4 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_status.message()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L6_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 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_4, __pyx_t_6};
            __pyx_t_8 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 52, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_safe, Py_True, __pyx_t_8, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 52, __pyx_L6_error)
            __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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, 52, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __pyx_v_message = __pyx_t_3;
          __pyx_t_3 = 0;

          /* "pyarrow/_flight.pyx":53
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
 *             detail_msg = detail.get().extra_info()             # <<<<<<<<<<<<<<
 *             if detail.get().code() == CFlightStatusInternal:
 *                 raise FlightInternalError(message, detail_msg)
*/
          __pyx_v_detail_msg = __pyx_v_detail.get()->extra_info();

          /* "pyarrow/_flight.pyx":54
 *             message = frombytes(status.message(), safe=True)
 *             detail_msg = detail.get().extra_info()
 *             if detail.get().code() == CFlightStatusInternal:             # <<<<<<<<<<<<<<
 *                 raise FlightInternalError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusFailed:
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Internal);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":55
 *             detail_msg = detail.get().extra_info()
 *             if detail.get().code() == CFlightStatusInternal:
 *                 raise FlightInternalError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusFailed:
 *                 message = _munge_grpc_python_error(message)
*/
            __pyx_t_5 = NULL;
            __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_message, __pyx_t_8};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInternalError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 55, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":54
 *             message = frombytes(status.message(), safe=True)
 *             detail_msg = detail.get().extra_info()
 *             if detail.get().code() == CFlightStatusInternal:             # <<<<<<<<<<<<<<
 *                 raise FlightInternalError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusFailed:
*/
          }

          /* "pyarrow/_flight.pyx":56
 *             if detail.get().code() == CFlightStatusInternal:
 *                 raise FlightInternalError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusFailed:             # <<<<<<<<<<<<<<
 *                 message = _munge_grpc_python_error(message)
 *                 raise FlightServerError(message, detail_msg)
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Failed);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":57
 *                 raise FlightInternalError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusFailed:
 *                 message = _munge_grpc_python_error(message)             # <<<<<<<<<<<<<<
 *                 raise FlightServerError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusTimedOut:
*/
            __pyx_t_8 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_munge_grpc_python_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_5))) {
              __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
              assert(__pyx_t_8);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
              __pyx_t_7 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_message};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);
            }
            __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3);
            __pyx_t_3 = 0;

            /* "pyarrow/_flight.pyx":58
 *             elif detail.get().code() == CFlightStatusFailed:
 *                 message = _munge_grpc_python_error(message)
 *                 raise FlightServerError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusTimedOut:
 *                 raise FlightTimedOutError(message, detail_msg)
*/
            __pyx_t_5 = NULL;
            __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_message, __pyx_t_8};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 58, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":56
 *             if detail.get().code() == CFlightStatusInternal:
 *                 raise FlightInternalError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusFailed:             # <<<<<<<<<<<<<<
 *                 message = _munge_grpc_python_error(message)
 *                 raise FlightServerError(message, detail_msg)
*/
          }

          /* "pyarrow/_flight.pyx":59
 *                 message = _munge_grpc_python_error(message)
 *                 raise FlightServerError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusTimedOut:             # <<<<<<<<<<<<<<
 *                 raise FlightTimedOutError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusCancelled:
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::TimedOut);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":60
 *                 raise FlightServerError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusTimedOut:
 *                 raise FlightTimedOutError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusCancelled:
 *                 raise FlightCancelledError(message, detail_msg)
*/
            __pyx_t_8 = NULL;
            __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_message, __pyx_t_5};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 60, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":59
 *                 message = _munge_grpc_python_error(message)
 *                 raise FlightServerError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusTimedOut:             # <<<<<<<<<<<<<<
 *                 raise FlightTimedOutError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusCancelled:
*/
          }

          /* "pyarrow/_flight.pyx":61
 *             elif detail.get().code() == CFlightStatusTimedOut:
 *                 raise FlightTimedOutError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusCancelled:             # <<<<<<<<<<<<<<
 *                 raise FlightCancelledError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Cancelled);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":62
 *                 raise FlightTimedOutError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusCancelled:
 *                 raise FlightCancelledError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
 *                 raise FlightUnauthenticatedError(message, detail_msg)
*/
            __pyx_t_5 = NULL;
            __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_message, __pyx_t_8};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 62, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":61
 *             elif detail.get().code() == CFlightStatusTimedOut:
 *                 raise FlightTimedOutError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusCancelled:             # <<<<<<<<<<<<<<
 *                 raise FlightCancelledError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
*/
          }

          /* "pyarrow/_flight.pyx":63
 *             elif detail.get().code() == CFlightStatusCancelled:
 *                 raise FlightCancelledError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthenticated:             # <<<<<<<<<<<<<<
 *                 raise FlightUnauthenticatedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthorized:
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Unauthenticated);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":64
 *                 raise FlightCancelledError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
 *                 raise FlightUnauthenticatedError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusUnauthorized:
 *                 raise FlightUnauthorizedError(message, detail_msg)
*/
            __pyx_t_8 = NULL;
            __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_message, __pyx_t_5};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 64, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":63
 *             elif detail.get().code() == CFlightStatusCancelled:
 *                 raise FlightCancelledError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthenticated:             # <<<<<<<<<<<<<<
 *                 raise FlightUnauthenticatedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthorized:
*/
          }

          /* "pyarrow/_flight.pyx":65
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
 *                 raise FlightUnauthenticatedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthorized:             # <<<<<<<<<<<<<<
 *                 raise FlightUnauthorizedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnavailable:
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Unauthorized);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":66
 *                 raise FlightUnauthenticatedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthorized:
 *                 raise FlightUnauthorizedError(message, detail_msg)             # <<<<<<<<<<<<<<
 *             elif detail.get().code() == CFlightStatusUnavailable:
 *                 raise FlightUnavailableError(message, detail_msg)
*/
            __pyx_t_5 = NULL;
            __pyx_t_8 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_message, __pyx_t_8};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 66, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":65
 *             elif detail.get().code() == CFlightStatusUnauthenticated:
 *                 raise FlightUnauthenticatedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnauthorized:             # <<<<<<<<<<<<<<
 *                 raise FlightUnauthorizedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnavailable:
*/
          }

          /* "pyarrow/_flight.pyx":67
 *             elif detail.get().code() == CFlightStatusUnauthorized:
 *                 raise FlightUnauthorizedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnavailable:             # <<<<<<<<<<<<<<
 *                 raise FlightUnavailableError(message, detail_msg)
 * 
*/
          __pyx_t_1 = (__pyx_v_detail.get()->code() ==  arrow::flight::FlightStatusCode::Unavailable);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/_flight.pyx":68
 *                 raise FlightUnauthorizedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnavailable:
 *                 raise FlightUnavailableError(message, detail_msg)             # <<<<<<<<<<<<<<
 * 
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
*/
            __pyx_t_8 = NULL;
            __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_detail_msg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L6_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_message, __pyx_t_5};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __Pyx_Raise(((PyObject *)__pyx_t_3), 0, 0, 0);
            __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
            __PYX_ERR(0, 68, __pyx_L6_error)

            /* "pyarrow/_flight.pyx":67
 *             elif detail.get().code() == CFlightStatusUnauthorized:
 *                 raise FlightUnauthorizedError(message, detail_msg)
 *             elif detail.get().code() == CFlightStatusUnavailable:             # <<<<<<<<<<<<<<
 *                 raise FlightUnavailableError(message, detail_msg)
 * 
*/
          }
        }

        /* "pyarrow/_flight.pyx":51
 *     detail = FlightStatusDetail.UnwrapStatus(status)
 *     if detail:
 *         with gil:             # <<<<<<<<<<<<<<
 *             message = frombytes(status.message(), safe=True)
 *             detail_msg = detail.get().extra_info()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            goto __pyx_L7;
          }
          __pyx_L6_error: {
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            goto __pyx_L1_error;
          }
          __pyx_L7:;
        }
    }

    /* "pyarrow/_flight.pyx":50
 * 
 *     detail = FlightStatusDetail.UnwrapStatus(status)
 *     if detail:             # <<<<<<<<<<<<<<
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
*/
  }

  /* "pyarrow/_flight.pyx":70
 *                 raise FlightUnavailableError(message, detail_msg)
 * 
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)             # <<<<<<<<<<<<<<
 *     if size_detail:
 *         with gil:
*/
  __pyx_v_size_detail =  arrow::flight::FlightWriteSizeStatusDetail::UnwrapStatus(__pyx_v_status);

  /* "pyarrow/_flight.pyx":71
 * 
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
 *     if size_detail:             # <<<<<<<<<<<<<<
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
*/
  __pyx_t_2 = __pyx_v_size_detail.operator bool();
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":72
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
 *     if size_detail:
 *         with gil:             # <<<<<<<<<<<<<<
 *             message = frombytes(status.message(), safe=True)
 *             raise FlightWriteSizeExceededError(
*/
    {
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        /*try:*/ {

          /* "pyarrow/_flight.pyx":73
 *     if size_detail:
 *         with gil:
 *             message = frombytes(status.message(), safe=True)             # <<<<<<<<<<<<<<
 *             raise FlightWriteSizeExceededError(
 *                 message,
*/
          __pyx_t_5 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_6 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_status.message()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_5);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_6};
            __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_safe, Py_True, __pyx_t_4, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 73, __pyx_L11_error)
            __pyx_t_3 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
            __Pyx_XDECREF(__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;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_3);
          }
          __Pyx_XDECREF_SET(__pyx_v_message, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "pyarrow/_flight.pyx":74
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
 *             raise FlightWriteSizeExceededError(             # <<<<<<<<<<<<<<
 *                 message,
 *                 size_detail.get().limit(), size_detail.get().actual())
*/
          __pyx_t_8 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FlightWriteSizeExceededError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_4);

          /* "pyarrow/_flight.pyx":76
 *             raise FlightWriteSizeExceededError(
 *                 message,
 *                 size_detail.get().limit(), size_detail.get().actual())             # <<<<<<<<<<<<<<
 * 
 *     return check_status(status)
*/
          __pyx_t_6 = __Pyx_PyLong_From_int64_t(__pyx_v_size_detail.get()->limit()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 76, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_size_detail.get()->actual()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_7 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
            assert(__pyx_t_8);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
            __pyx_t_7 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_v_message, __pyx_t_6, __pyx_t_5};
            __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L11_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, 74, __pyx_L11_error)
        }

        /* "pyarrow/_flight.pyx":72
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
 *     if size_detail:
 *         with gil:             # <<<<<<<<<<<<<<
 *             message = frombytes(status.message(), safe=True)
 *             raise FlightWriteSizeExceededError(
*/
        /*finally:*/ {
          __pyx_L11_error: {
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            goto __pyx_L1_error;
          }
        }
    }

    /* "pyarrow/_flight.pyx":71
 * 
 *     size_detail = FlightWriteSizeStatusDetail.UnwrapStatus(status)
 *     if size_detail:             # <<<<<<<<<<<<<<
 *         with gil:
 *             message = frombytes(status.message(), safe=True)
*/
  }

  /* "pyarrow/_flight.pyx":78
 *                 size_detail.get().limit(), size_detail.get().actual())
 * 
 *     return check_status(status)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_status); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 78, __pyx_L1_error)
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":43
 * 
 * 
 * cdef int check_flight_status(const CStatus& status) except -1 nogil:             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[FlightStatusDetail] detail
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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("pyarrow._flight.check_flight_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":88
 * 
 * 
 * def _munge_grpc_python_error(message):             # <<<<<<<<<<<<<<
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_1_munge_grpc_python_error(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_7pyarrow_7_flight__munge_grpc_python_error, "_munge_grpc_python_error(message)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_1_munge_grpc_python_error = {"_munge_grpc_python_error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_1_munge_grpc_python_error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight__munge_grpc_python_error};
static PyObject *__pyx_pw_7pyarrow_7_flight_1_munge_grpc_python_error(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_message = 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("_munge_grpc_python_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);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_message,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, 88, __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, 88, __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, "_munge_grpc_python_error", 0) < (0)) __PYX_ERR(0, 88, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_munge_grpc_python_error", 1, 1, 1, i); __PYX_ERR(0, 88, __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, 88, __pyx_L3_error)
    }
    __pyx_v_message = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_munge_grpc_python_error", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 88, __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("pyarrow._flight._munge_grpc_python_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight__munge_grpc_python_error(__pyx_self, __pyx_v_message);

  /* 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_7pyarrow_7_flight__munge_grpc_python_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) {
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_munge_grpc_python_error", 0);

  /* "pyarrow/_flight.pyx":89
 * 
 * def _munge_grpc_python_error(message):
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)             # <<<<<<<<<<<<<<
 *     if m:
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FLIGHT_SERVER_ERROR_REGEX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __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_message};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_m = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":90
 * def _munge_grpc_python_error(message):
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:             # <<<<<<<<<<<<<<
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'
 *     else:
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_m); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 90, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "pyarrow/_flight.pyx":91
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'             # <<<<<<<<<<<<<<
 *     else:
 *         return message
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_m, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Flight_RPC_failed_with_Python_ex;
    __pyx_t_7[1] = __pyx_t_1;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_;
    __pyx_t_7[3] = __pyx_t_4;
    __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u__2;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_7, 5, 41 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":90
 * def _munge_grpc_python_error(message):
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:             # <<<<<<<<<<<<<<
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'
 *     else:
*/
  }

  /* "pyarrow/_flight.pyx":93
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'
 *     else:
 *         return message             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_message);
    __pyx_r = __pyx_v_message;
    goto __pyx_L0;
  }

  /* "pyarrow/_flight.pyx":88
 * 
 * 
 * def _munge_grpc_python_error(message):             # <<<<<<<<<<<<<<
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:
*/

  /* 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("pyarrow._flight._munge_grpc_python_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":96
 * 
 * 
 * cdef IpcWriteOptions _get_options(options):             # <<<<<<<<<<<<<<
 *     return <IpcWriteOptions> _get_legacy_format_default(options=options)
 * 
*/

static struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_f_7pyarrow_7_flight__get_options(PyObject *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_options", 0);

  /* "pyarrow/_flight.pyx":97
 * 
 * cdef IpcWriteOptions _get_options(options):
 *     return <IpcWriteOptions> _get_legacy_format_default(options=options)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_legacy_format_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __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 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_options, __pyx_v_options, __pyx_t_5, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 97, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __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, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_INCREF((PyObject *)((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_1));
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":96
 * 
 * 
 * cdef IpcWriteOptions _get_options(options):             # <<<<<<<<<<<<<<
 *     return <IpcWriteOptions> _get_legacy_format_default(options=options)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight._get_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":106
 *         CFlightCallOptions options
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,             # <<<<<<<<<<<<<<
 *                  IpcReadOptions read_options=None):
 *         """Create call options.
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightCallOptions___init__, "Create call options.\n\n        Parameters\n        ----------\n        timeout : float, None\n            A timeout for the call, in seconds. None means that the\n            timeout defaults to an implementation-specific value.\n        write_options : pyarrow.ipc.IpcWriteOptions, optional\n            IPC write options. The default options can be controlled\n            by environment variables (see pyarrow.ipc).\n        headers : List[Tuple[str, str]], optional\n            A list of arbitrary headers as key, value tuples\n        read_options : pyarrow.ipc.IpcReadOptions, optional\n            Serialization options for reading IPC format.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_17FlightCallOptions___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_write_options = 0;
  PyObject *__pyx_v_headers = 0;
  struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *__pyx_v_read_options = 0;
  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_timeout,&__pyx_mstate_global->__pyx_n_u_write_options,&__pyx_mstate_global->__pyx_n_u_headers,&__pyx_mstate_global->__pyx_n_u_read_options,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, 106, __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, 106, __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, 106, __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, 106, __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, 106, __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, 106, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":107
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,
 *                  IpcReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         """Create call options.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 106, __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, 106, __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, 106, __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, 106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_flight.pyx":106
 *         CFlightCallOptions options
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,             # <<<<<<<<<<<<<<
 *                  IpcReadOptions read_options=None):
 *         """Create call options.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":107
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,
 *                  IpcReadOptions read_options=None):             # <<<<<<<<<<<<<<
 *         """Create call options.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *)Py_None));
    }
    __pyx_v_timeout = values[0];
    __pyx_v_write_options = values[1];
    __pyx_v_headers = values[2];
    __pyx_v_read_options = ((struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, __pyx_nargs); __PYX_ERR(0, 106, __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("pyarrow._flight.FlightCallOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_IpcReadOptions, 1, "read_options", 0))) __PYX_ERR(0, 107, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17FlightCallOptions___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self), __pyx_v_timeout, __pyx_v_write_options, __pyx_v_headers, __pyx_v_read_options);

  /* "pyarrow/_flight.pyx":106
 *         CFlightCallOptions options
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,             # <<<<<<<<<<<<<<
 *                  IpcReadOptions read_options=None):
 *         """Create call options.
*/

  /* 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_7pyarrow_7_flight_17FlightCallOptions___init__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self, PyObject *__pyx_v_timeout, PyObject *__pyx_v_write_options, PyObject *__pyx_v_headers, struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *__pyx_v_read_options) {
  struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *__pyx_v_c_write_options = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
   arrow::ipc::IpcWriteOptions __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
   arrow::ipc::IpcReadOptions __pyx_t_10;
  std::vector<std::pair<std::string,std::string> >  __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":125
 *         cdef IpcWriteOptions c_write_options
 * 
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             self.options.timeout = CTimeoutDuration(timeout)
 *         if write_options is not None:
*/
  __pyx_t_1 = (__pyx_v_timeout != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":126
 * 
 *         if timeout is not None:
 *             self.options.timeout = CTimeoutDuration(timeout)             # <<<<<<<<<<<<<<
 *         if write_options is not None:
 *             c_write_options = _get_options(write_options)
*/
    __pyx_t_2 = __Pyx_PyFloat_AsDouble(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error)
    __pyx_v_self->options.timeout =  arrow::flight::TimeoutDuration(__pyx_t_2);

    /* "pyarrow/_flight.pyx":125
 *         cdef IpcWriteOptions c_write_options
 * 
 *         if timeout is not None:             # <<<<<<<<<<<<<<
 *             self.options.timeout = CTimeoutDuration(timeout)
 *         if write_options is not None:
*/
  }

  /* "pyarrow/_flight.pyx":127
 *         if timeout is not None:
 *             self.options.timeout = CTimeoutDuration(timeout)
 *         if write_options is not None:             # <<<<<<<<<<<<<<
 *             c_write_options = _get_options(write_options)
 *             self.options.write_options = c_write_options.c_options
*/
  __pyx_t_1 = (__pyx_v_write_options != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":128
 *             self.options.timeout = CTimeoutDuration(timeout)
 *         if write_options is not None:
 *             c_write_options = _get_options(write_options)             # <<<<<<<<<<<<<<
 *             self.options.write_options = c_write_options.c_options
 *         if read_options is not None:
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_7pyarrow_7_flight__get_options(__pyx_v_write_options)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_c_write_options = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":129
 *         if write_options is not None:
 *             c_write_options = _get_options(write_options)
 *             self.options.write_options = c_write_options.c_options             # <<<<<<<<<<<<<<
 *         if read_options is not None:
 *             if not isinstance(read_options, IpcReadOptions):
*/
    __pyx_t_4 = __pyx_v_c_write_options->c_options;
    __pyx_v_self->options.write_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

    /* "pyarrow/_flight.pyx":127
 *         if timeout is not None:
 *             self.options.timeout = CTimeoutDuration(timeout)
 *         if write_options is not None:             # <<<<<<<<<<<<<<
 *             c_write_options = _get_options(write_options)
 *             self.options.write_options = c_write_options.c_options
*/
  }

  /* "pyarrow/_flight.pyx":130
 *             c_write_options = _get_options(write_options)
 *             self.options.write_options = c_write_options.c_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(read_options, IpcReadOptions):
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_read_options) != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":131
 *             self.options.write_options = c_write_options.c_options
 *         if read_options is not None:
 *             if not isinstance(read_options, IpcReadOptions):             # <<<<<<<<<<<<<<
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
 *             self.options.read_options = read_options.c_options
*/
    __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_read_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_IpcReadOptions); 
    __pyx_t_5 = (!__pyx_t_1);
    if (unlikely(__pyx_t_5)) {

      /* "pyarrow/_flight.pyx":132
 *         if read_options is not None:
 *             if not isinstance(read_options, IpcReadOptions):
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")             # <<<<<<<<<<<<<<
 *             self.options.read_options = read_options.c_options
 *         if headers is not None:
*/
      __pyx_t_6 = NULL;
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_read_options))), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_expected_IpcReadOptions_got, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __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, 132, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":131
 *             self.options.write_options = c_write_options.c_options
 *         if read_options is not None:
 *             if not isinstance(read_options, IpcReadOptions):             # <<<<<<<<<<<<<<
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
 *             self.options.read_options = read_options.c_options
*/
    }

    /* "pyarrow/_flight.pyx":133
 *             if not isinstance(read_options, IpcReadOptions):
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
 *             self.options.read_options = read_options.c_options             # <<<<<<<<<<<<<<
 *         if headers is not None:
 *             self.options.headers = headers
*/
    __pyx_t_10 = __pyx_v_read_options->c_options;
    __pyx_v_self->options.read_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);

    /* "pyarrow/_flight.pyx":130
 *             c_write_options = _get_options(write_options)
 *             self.options.write_options = c_write_options.c_options
 *         if read_options is not None:             # <<<<<<<<<<<<<<
 *             if not isinstance(read_options, IpcReadOptions):
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
*/
  }

  /* "pyarrow/_flight.pyx":134
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
 *             self.options.read_options = read_options.c_options
 *         if headers is not None:             # <<<<<<<<<<<<<<
 *             self.options.headers = headers
 * 
*/
  __pyx_t_5 = (__pyx_v_headers != Py_None);
  if (__pyx_t_5) {

    /* "pyarrow/_flight.pyx":135
 *             self.options.read_options = read_options.c_options
 *         if headers is not None:
 *             self.options.headers = headers             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
    __pyx_t_11 = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_v_headers); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
    __pyx_v_self->options.headers = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

    /* "pyarrow/_flight.pyx":134
 *                 raise TypeError(f"expected IpcReadOptions, got {type(read_options)}")
 *             self.options.read_options = read_options.c_options
 *         if headers is not None:             # <<<<<<<<<<<<<<
 *             self.options.headers = headers
 * 
*/
  }

  /* "pyarrow/_flight.pyx":106
 *         CFlightCallOptions options
 * 
 *     def __init__(self, timeout=None, write_options=None, headers=None,             # <<<<<<<<<<<<<<
 *                  IpcReadOptions read_options=None):
 *         """Create call options.
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c_write_options);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":137
 *             self.options.headers = headers
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CFlightCallOptions* unwrap(obj):
 *         if not obj:
*/

static  arrow::flight::FlightCallOptions *__pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(PyObject *__pyx_v_obj) {
   arrow::flight::FlightCallOptions *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[3];
  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("unwrap", 0);

  /* "pyarrow/_flight.pyx":139
 *     @staticmethod
 *     cdef CFlightCallOptions* unwrap(obj):
 *         if not obj:             # <<<<<<<<<<<<<<
 *             return &DEFAULT_CALL_OPTIONS
 *         elif isinstance(obj, FlightCallOptions):
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 139, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":140
 *     cdef CFlightCallOptions* unwrap(obj):
 *         if not obj:
 *             return &DEFAULT_CALL_OPTIONS             # <<<<<<<<<<<<<<
 *         elif isinstance(obj, FlightCallOptions):
 *             return &((<FlightCallOptions> obj).options)
*/
    __pyx_r = (&__pyx_v_7pyarrow_7_flight_DEFAULT_CALL_OPTIONS);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":139
 *     @staticmethod
 *     cdef CFlightCallOptions* unwrap(obj):
 *         if not obj:             # <<<<<<<<<<<<<<
 *             return &DEFAULT_CALL_OPTIONS
 *         elif isinstance(obj, FlightCallOptions):
*/
  }

  /* "pyarrow/_flight.pyx":141
 *         if not obj:
 *             return &DEFAULT_CALL_OPTIONS
 *         elif isinstance(obj, FlightCallOptions):             # <<<<<<<<<<<<<<
 *             return &((<FlightCallOptions> obj).options)
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions); 
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":142
 *             return &DEFAULT_CALL_OPTIONS
 *         elif isinstance(obj, FlightCallOptions):
 *             return &((<FlightCallOptions> obj).options)             # <<<<<<<<<<<<<<
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")
 * 
*/
    __pyx_r = (&((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_obj)->options);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":141
 *         if not obj:
 *             return &DEFAULT_CALL_OPTIONS
 *         elif isinstance(obj, FlightCallOptions):             # <<<<<<<<<<<<<<
 *             return &((<FlightCallOptions> obj).options)
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")
*/
  }

  /* "pyarrow/_flight.pyx":143
 *         elif isinstance(obj, FlightCallOptions):
 *             return &((<FlightCallOptions> obj).options)
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Expected_a_FlightCallOptions_obj;
  __pyx_t_6[1] = __pyx_t_5;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 42 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __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, 143, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":137
 *             self.options.headers = headers
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CFlightCallOptions* unwrap(obj):
 *         if not obj:
*/

  /* 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_7);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.unwrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":145
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def timeout(self):
 *         """Get timeout for the call (in seconds)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7timeout_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7timeout_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_7pyarrow_7_flight_17FlightCallOptions_7timeout___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_7timeout___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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);

  /* "pyarrow/_flight.pyx":149
 *         """Get timeout for the call (in seconds)
 *         """
 *         return self.options.timeout.count()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->options.timeout.count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":145
 *         raise TypeError(f"Expected a FlightCallOptions object, not '{type(obj)}'")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def timeout(self):
 *         """Get timeout for the call (in seconds)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.timeout.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":151
 *         return self.options.timeout.count()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def headers(self):
 *         """Get list of headers (key, value tuples) for client's context
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7headers_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7headers_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_7pyarrow_7_flight_17FlightCallOptions_7headers___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_7headers___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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);

  /* "pyarrow/_flight.pyx":155
 *         """Get list of headers (key, value tuples) for client's context
 *         """
 *         return self.options.headers             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_v_self->options.headers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":151
 *         return self.options.timeout.count()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def headers(self):
 *         """Get list of headers (key, value tuples) for client's context
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.headers.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":157
 *         return self.options.headers
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         """Get serialization options for reading IPC format
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_12read_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_12read_options_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_7pyarrow_7_flight_17FlightCallOptions_12read_options___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_12read_options___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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);

  /* "pyarrow/_flight.pyx":161
 *         """Get serialization options for reading IPC format
 *         """
 *         return wrap_ipc_read_options(self.options.read_options)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_wrap_ipc_read_options(__pyx_v_self->options.read_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":157
 *         return self.options.headers
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def read_options(self):
 *         """Get serialization options for reading IPC format
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.read_options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":163
 *         return wrap_ipc_read_options(self.options.read_options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         """Get IPC write options
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_13write_options_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_13write_options_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_7pyarrow_7_flight_17FlightCallOptions_13write_options___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_13write_options___get__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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);

  /* "pyarrow/_flight.pyx":167
 *         """Get IPC write options
 *         """
 *         return wrap_ipc_write_options(self.options.write_options)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_wrap_ipc_write_options(__pyx_v_self->options.write_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":163
 *         return wrap_ipc_read_options(self.options.read_options)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def write_options(self):
 *         """Get IPC write options
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.write_options.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":169
 *         return wrap_ipc_write_options(self.options.write_options)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightCallOptions "
 *                 f"timeout={self.timeout} "
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_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_7pyarrow_7_flight_17FlightCallOptions_2__repr__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_2__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[9];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":170
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightCallOptions "             # <<<<<<<<<<<<<<
 *                 f"timeout={self.timeout} "
 *                 f"headers={self.headers}\n"
*/
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/_flight.pyx":171
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightCallOptions "
 *                 f"timeout={self.timeout} "             # <<<<<<<<<<<<<<
 *                 f"headers={self.headers}\n"
 *                 f" read_options={self.read_options}\n"
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":172
 *         return (f"<pyarrow.flight.FlightCallOptions "
 *                 f"timeout={self.timeout} "
 *                 f"headers={self.headers}\n"             # <<<<<<<<<<<<<<
 *                 f" read_options={self.read_options}\n"
 *                 f" write_options={self.write_options}\n>")
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_headers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":173
 *                 f"timeout={self.timeout} "
 *                 f"headers={self.headers}\n"
 *                 f" read_options={self.read_options}\n"             # <<<<<<<<<<<<<<
 *                 f" write_options={self.write_options}\n>")
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_read_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":174
 *                 f"headers={self.headers}\n"
 *                 f" read_options={self.read_options}\n"
 *                 f" write_options={self.write_options}\n>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightCallOption;
  __pyx_t_6[1] = __pyx_t_2;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_headers_2;
  __pyx_t_6[3] = __pyx_t_3;
  __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_read_options_2;
  __pyx_t_6[5] = __pyx_t_4;
  __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u_write_options_2;
  __pyx_t_6[7] = __pyx_t_5;
  __pyx_t_6[8] = __pyx_mstate_global->__pyx_kp_u__4;

  /* "pyarrow/_flight.pyx":170
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightCallOptions "             # <<<<<<<<<<<<<<
 *                 f"timeout={self.timeout} "
 *                 f"headers={self.headers}\n"
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 9, 42 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":169
 *         return wrap_ipc_write_options(self.options.write_options)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightCallOptions "
 *                 f"timeout={self.timeout} "
*/

  /* 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("pyarrow._flight.FlightCallOptions.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__, "FlightCallOptions.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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.options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_options_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightCallOptions.__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.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__, "FlightCallOptions.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightCallOptions.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)__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_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__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.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_options_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":208
 *     cdef dict __dict__
 * 
 *     def __init__(self, message='', extra_info=b''):             # <<<<<<<<<<<<<<
 *         super().__init__(message)
 *         self.extra_info = tobytes(extra_info)
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_extra_info = 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_message,&__pyx_mstate_global->__pyx_n_u_extra_info,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, 208, __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, 208, __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, 208, __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, 208, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__5));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_b__5));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 208, __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, 208, __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__5));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_b__5));
    }
    __pyx_v_message = values[0];
    __pyx_v_extra_info = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 208, __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("pyarrow._flight.FlightError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_11FlightError___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_self), __pyx_v_message, __pyx_v_extra_info);

  /* 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_7pyarrow_7_flight_11FlightError___init__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_extra_info) {
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":209
 * 
 *     def __init__(self, message='', extra_info=b''):
 *         super().__init__(message)             # <<<<<<<<<<<<<<
 *         self.extra_info = tobytes(extra_info)
 * 
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), ((PyObject *)__pyx_v_self)};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__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, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":210
 *     def __init__(self, message='', extra_info=b''):
 *         super().__init__(message)
 *         self.extra_info = tobytes(extra_info)             # <<<<<<<<<<<<<<
 * 
 *     cdef CStatus to_status(self):
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_extra_info};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __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_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info, __pyx_t_1) < (0)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":208
 *     cdef dict __dict__
 * 
 *     def __init__(self, message='', extra_info=b''):             # <<<<<<<<<<<<<<
 *         super().__init__(message)
 *         self.extra_info = tobytes(extra_info)
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.FlightError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":212
 *         self.extra_info = tobytes(extra_info)
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         message = tobytes(f"Flight error: {self}")
 *         return CStatus_UnknownError(message)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_11FlightError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self) {
  PyObject *__pyx_v_message = NULL;
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":213
 * 
 *     cdef CStatus to_status(self):
 *         message = tobytes(f"Flight error: {self}")             # <<<<<<<<<<<<<<
 *         return CStatus_UnknownError(message)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Flight_error, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __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_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_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_message = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":214
 *     cdef CStatus to_status(self):
 *         message = tobytes(f"Flight error: {self}")
 *         return CStatus_UnknownError(message)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_message); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
  __pyx_r = arrow::Status::UnknownError(__pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":212
 *         self.extra_info = tobytes(extra_info)
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         message = tobytes(f"Flight error: {self}")
 *         return CStatus_UnknownError(message)
*/

  /* 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("pyarrow._flight.FlightError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11FlightError_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_11FlightError_2__reduce_cython__, "FlightError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11FlightError_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11FlightError_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11FlightError_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_11FlightError_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_11FlightError_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_11FlightError_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11FlightError_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_11FlightError_4__setstate_cython__, "FlightError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11FlightError_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11FlightError_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11FlightError_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_11FlightError_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_11FlightError_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__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_7pyarrow_7_flight_11FlightError_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":220
 *     """An error internal to the Flight server occurred."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusInternal,
 *                                tobytes(str(self)), self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_19FlightInternalError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":222
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusInternal,
 *                                tobytes(str(self)), self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __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((PyObject*)__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, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":221
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusInternal,             # <<<<<<<<<<<<<<
 *                                tobytes(str(self)), self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Internal, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":220
 *     """An error internal to the Flight server occurred."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusInternal,
 *                                tobytes(str(self)), self.extra_info)
*/

  /* 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("pyarrow._flight.FlightInternalError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightInternalError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19FlightInternalError___reduce_cython__, "FlightInternalError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19FlightInternalError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightInternalError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightInternalError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightInternalError_1__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_7pyarrow_7_flight_19FlightInternalError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightInternalError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightInternalErr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightInternalError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightInternalErr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightInternalError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightInternalError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__, "FlightInternalError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightInternalError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *)__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_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightInternalError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightInternalError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightInternalError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightInternalError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":228
 *     """The Flight RPC call timed out."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusTimedOut,
 *                                tobytes(str(self)), self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_19FlightTimedOutError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":230
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusTimedOut,
 *                                tobytes(str(self)), self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __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((PyObject*)__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, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":229
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusTimedOut,             # <<<<<<<<<<<<<<
 *                                tobytes(str(self)), self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::TimedOut, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":228
 *     """The Flight RPC call timed out."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusTimedOut,
 *                                tobytes(str(self)), self.extra_info)
*/

  /* 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("pyarrow._flight.FlightTimedOutError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__, "FlightTimedOutError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19FlightTimedOutError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_1__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_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightTimedOutErr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightTimedOutError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightTimedOutErr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightTimedOutError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightTimedOutError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__, "FlightTimedOutError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightTimedOutError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *)__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_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightTimedOutError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightTimedOutError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightTimedOutError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightTimedOutError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":236
 *     """The operation was cancelled."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusCancelled, tobytes(str(self)),
 *                                self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_20FlightCancelledError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":237
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusCancelled, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __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((PyObject*)__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, 237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":238
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusCancelled, tobytes(str(self)),
 *                                self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":237
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusCancelled, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Cancelled, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":236
 *     """The operation was cancelled."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusCancelled, tobytes(str(self)),
 *                                self.extra_info)
*/

  /* 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("pyarrow._flight.FlightCancelledError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__, "FlightCancelledError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightCancelledError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_1__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_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightCancelledEr); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightCancelledError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightCancelledEr); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightCancelledError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightCancelledError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__, "FlightCancelledError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightCancelledError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *)__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_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightCancelledError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightCancelledError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightCancelledError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightCancelledError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":244
 *     """A server error occurred."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusFailed, tobytes(str(self)),
 *                                self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_17FlightServerError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":245
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusFailed, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __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((PyObject*)__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, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":246
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusFailed, tobytes(str(self)),
 *                                self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":245
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusFailed, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Failed, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":244
 *     """A server error occurred."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusFailed, tobytes(str(self)),
 *                                self.extra_info)
*/

  /* 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("pyarrow._flight.FlightServerError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightServerError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightServerError___reduce_cython__, "FlightServerError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightServerError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightServerError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightServerError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightServerError_1__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_7pyarrow_7_flight_17FlightServerError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightServerError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightServerError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightServerError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightServerError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightServerError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__, "FlightServerError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightServerError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerError *)__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_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightServerError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightServerError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightServerError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":252
 *     """The client is not authenticated."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(
 *             CFlightStatusUnauthenticated, tobytes(str(self)), self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_26FlightUnauthenticatedError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":254
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(
 *             CFlightStatusUnauthenticated, tobytes(str(self)), self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __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((PyObject*)__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, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":253
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(             # <<<<<<<<<<<<<<
 *             CFlightStatusUnauthenticated, tobytes(str(self)), self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Unauthenticated, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":252
 *     """The client is not authenticated."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(
 *             CFlightStatusUnauthenticated, tobytes(str(self)), self.extra_info)
*/

  /* 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("pyarrow._flight.FlightUnauthenticatedError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__, "FlightUnauthenticatedError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26FlightUnauthenticatedError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_1__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_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthentic); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnauthenticatedError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthentic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnauthenticatedError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthenticatedError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__, "FlightUnauthenticatedError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightUnauthenticatedError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *)__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_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnauthenticatedError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthenticatedError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthenticatedError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnauthenticatedError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":260
 *     """The client is not authorized to perform the given operation."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusUnauthorized, tobytes(str(self)),
 *                                self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_23FlightUnauthorizedError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":261
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnauthorized, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __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((PyObject*)__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, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":262
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnauthorized, tobytes(str(self)),
 *                                self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":261
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnauthorized, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Unauthorized, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":260
 *     """The client is not authorized to perform the given operation."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusUnauthorized, tobytes(str(self)),
 *                                self.extra_info)
*/

  /* 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("pyarrow._flight.FlightUnauthorizedError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__, "FlightUnauthorizedError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23FlightUnauthorizedError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_1__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_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthorize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnauthorizedError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthorize); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnauthorizedError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthorizedError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__, "FlightUnauthorizedError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightUnauthorizedError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *)__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_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnauthorizedError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthorizedError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthorizedError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnauthorizedError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":268
 *     """The server is not reachable or available."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusUnavailable, tobytes(str(self)),
 *                                self.extra_info)
*/

static arrow::Status __pyx_f_7pyarrow_7_flight_22FlightUnavailableError_to_status(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self) {
  arrow::Status __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;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_status", 0);

  /* "pyarrow/_flight.pyx":269
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnavailable, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Unicode(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __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((PyObject*)__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, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":270
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnavailable, tobytes(str(self)),
 *                                self.extra_info)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_extra_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":269
 * 
 *     cdef CStatus to_status(self):
 *         return MakeFlightError(CFlightStatusUnavailable, tobytes(str(self)),             # <<<<<<<<<<<<<<
 *                                self.extra_info)
 * 
*/
  __pyx_r =  arrow::flight::MakeFlightError( arrow::flight::FlightStatusCode::Unavailable, __pyx_t_6, __pyx_t_7);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":268
 *     """The server is not reachable or available."""
 * 
 *     cdef CStatus to_status(self):             # <<<<<<<<<<<<<<
 *         return MakeFlightError(CFlightStatusUnavailable, tobytes(str(self)),
 *                                self.extra_info)
*/

  /* 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("pyarrow._flight.FlightUnavailableError.to_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__, "FlightUnavailableError.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_22FlightUnavailableError_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_1__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_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnavailable); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnavailableError__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnavailable); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnavailableError.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnavailableError__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__, "FlightUnavailableError.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightUnavailableError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *)__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_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightUnavailableError__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnavailableError__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnavailableError__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightUnavailableError.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":276
 *     """A write operation exceeded the client-configured limit."""
 * 
 *     def __init__(self, message, limit, actual):             # <<<<<<<<<<<<<<
 *         super().__init__(message)
 *         self.limit = limit
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_28FlightWriteSizeExceededError_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_28FlightWriteSizeExceededError___init__, "FlightWriteSizeExceededError.__init__(self, message, limit, actual)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_28FlightWriteSizeExceededError_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_28FlightWriteSizeExceededError_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_28FlightWriteSizeExceededError___init__};
static PyObject *__pyx_pw_7pyarrow_7_flight_28FlightWriteSizeExceededError_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_actual = 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("__init__ (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_self,&__pyx_mstate_global->__pyx_n_u_message,&__pyx_mstate_global->__pyx_n_u_limit,&__pyx_mstate_global->__pyx_n_u_actual,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, 276, __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, 276, __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, 276, __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, 276, __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, 276, __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, 276, __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, 276, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      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, 276, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 276, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 276, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 276, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_message = values[1];
    __pyx_v_limit = values[2];
    __pyx_v_actual = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 276, __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("pyarrow._flight.FlightWriteSizeExceededError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_28FlightWriteSizeExceededError___init__(__pyx_self, __pyx_v_self, __pyx_v_message, __pyx_v_limit, __pyx_v_actual);

  /* 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_7pyarrow_7_flight_28FlightWriteSizeExceededError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_limit, PyObject *__pyx_v_actual) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":277
 * 
 *     def __init__(self, message, limit, actual):
 *         super().__init__(message)             # <<<<<<<<<<<<<<
 *         self.limit = limit
 *         self.actual = actual
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(0, 277, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__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, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_message};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__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, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":278
 *     def __init__(self, message, limit, actual):
 *         super().__init__(message)
 *         self.limit = limit             # <<<<<<<<<<<<<<
 *         self.actual = actual
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_limit, __pyx_v_limit) < (0)) __PYX_ERR(0, 278, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":279
 *         super().__init__(message)
 *         self.limit = limit
 *         self.actual = actual             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_actual, __pyx_v_actual) < (0)) __PYX_ERR(0, 279, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":276
 *     """A write operation exceeded the client-configured limit."""
 * 
 *     def __init__(self, message, limit, actual):             # <<<<<<<<<<<<<<
 *         super().__init__(message)
 *         self.limit = limit
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightWriteSizeExceededError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":287
 *         CAction action
 * 
 *     def __init__(self, action_type, buf):             # <<<<<<<<<<<<<<
 *         """Create an action from a type and a buffer.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_6Action_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Action___init__, "Create an action from a type and a buffer.\n\n        Parameters\n        ----------\n        action_type : bytes or str\n        buf : Buffer or bytes-like object\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_6Action___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_6Action_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_action_type = 0;
  PyObject *__pyx_v_buf = 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_action_type,&__pyx_mstate_global->__pyx_n_u_buf,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, 287, __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, 287, __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, 287, __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, 287, __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, 287, __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, 287, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 287, __pyx_L3_error)
    }
    __pyx_v_action_type = values[0];
    __pyx_v_buf = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 287, __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("pyarrow._flight.Action.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Action___init__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self), __pyx_v_action_type, __pyx_v_buf);

  /* 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_7pyarrow_7_flight_6Action___init__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self, PyObject *__pyx_v_action_type, PyObject *__pyx_v_buf) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  std::shared_ptr< arrow::Buffer>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":295
 *         buf : Buffer or bytes-like object
 *         """
 *         self.action.type = tobytes(action_type)             # <<<<<<<<<<<<<<
 *         self.action.body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __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_v_action_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->action.type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":296
 *         """
 *         self.action.type = tobytes(action_type)
 *         self.action.body = pyarrow_unwrap_buffer(as_buffer(buf))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_buf};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->action.body = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":287
 *         CAction action
 * 
 *     def __init__(self, action_type, buf):             # <<<<<<<<<<<<<<
 *         """Create an action from a type and a buffer.
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Action.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":298
 *         self.action.body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type(self):
 *         """The action type."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_4type_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_7pyarrow_7_flight_6Action_4type___get__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self));

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

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

  /* "pyarrow/_flight.pyx":301
 *     def type(self):
 *         """The action type."""
 *         return frombytes(self.action.type)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->action.type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __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((PyObject*)__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, 301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":298
 *         self.action.body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def type(self):
 *         """The action 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("pyarrow._flight.Action.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":303
 *         return frombytes(self.action.type)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def body(self):
 *         """The action body (arguments for the action)."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_4body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_4body_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_7pyarrow_7_flight_6Action_4body___get__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_4body___get__(struct __pyx_obj_7pyarrow_7_flight_Action *__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);

  /* "pyarrow/_flight.pyx":306
 *     def body(self):
 *         """The action body (arguments for the action)."""
 *         return pyarrow_wrap_buffer(self.action.body)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_self->action.body); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":303
 *         return frombytes(self.action.type)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def body(self):
 *         """The action body (arguments for the action)."""
*/

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

/* "pyarrow/_flight.pyx":308
 *         return pyarrow_wrap_buffer(self.action.body)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CAction unwrap(action) except *:
 *         if not isinstance(action, Action):
*/

static  arrow::flight::Action __pyx_f_7pyarrow_7_flight_6Action_unwrap(PyObject *__pyx_v_action) {
   arrow::flight::Action __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[3];
  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("unwrap", 0);

  /* "pyarrow/_flight.pyx":310
 *     @staticmethod
 *     cdef CAction unwrap(action) except *:
 *         if not isinstance(action, Action):             # <<<<<<<<<<<<<<
 *             raise TypeError(f"Must provide Action, not '{type(action)}'")
 *         return (<Action> action).action
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_action, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":311
 *     cdef CAction unwrap(action) except *:
 *         if not isinstance(action, Action):
 *             raise TypeError(f"Must provide Action, not '{type(action)}'")             # <<<<<<<<<<<<<<
 *         return (<Action> action).action
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_action)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Must_provide_Action_not;
    __pyx_t_6[1] = __pyx_t_5;
    __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__3;
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __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, 311, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":310
 *     @staticmethod
 *     cdef CAction unwrap(action) except *:
 *         if not isinstance(action, Action):             # <<<<<<<<<<<<<<
 *             raise TypeError(f"Must provide Action, not '{type(action)}'")
 *         return (<Action> action).action
*/
  }

  /* "pyarrow/_flight.pyx":312
 *         if not isinstance(action, Action):
 *             raise TypeError(f"Must provide Action, not '{type(action)}'")
 *         return (<Action> action).action             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __pyx_r = ((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_action)->action;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":308
 *         return pyarrow_wrap_buffer(self.action.body)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CAction unwrap(action) except *:
 *         if not isinstance(action, Action):
*/

  /* 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_7);
  __Pyx_AddTraceback("pyarrow._flight.Action.unwrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":314
 *         return (<Action> action).action
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Action_2serialize, "Action.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Action_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Action_2serialize(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_2serialize(struct __pyx_obj_7pyarrow_7_flight_Action *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":321
 * 
 *         """
 *         return GetResultValue(self.action.SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->action.SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":314
 *         return (<Action> action).action
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.Action.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":323
 *         return GetResultValue(self.action.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_5deserialize(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_7pyarrow_7_flight_6Action_4deserialize, "Action.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Action_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 323, __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, 323, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 323, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 323, __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, 323, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 323, __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("pyarrow._flight.Action.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Action_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_6Action_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_action = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::Action __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":331
 * 
 *         """
 *         cdef Action action = Action.__new__(Action)             # <<<<<<<<<<<<<<
 *         action.action = GetResultValue(
 *             CAction.Deserialize(tobytes(serialized)))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Action(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_action = ((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":333
 *         cdef Action action = Action.__new__(Action)
 *         action.action = GetResultValue(
 *             CAction.Deserialize(tobytes(serialized)))             # <<<<<<<<<<<<<<
 *         return action
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":332
 *         """
 *         cdef Action action = Action.__new__(Action)
 *         action.action = GetResultValue(             # <<<<<<<<<<<<<<
 *             CAction.Deserialize(tobytes(serialized)))
 *         return action
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::Action>( arrow::flight::Action::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
  __pyx_v_action->action = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":334
 *         action.action = GetResultValue(
 *             CAction.Deserialize(tobytes(serialized)))
 *         return action             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, Action other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_action);
  __pyx_r = ((PyObject *)__pyx_v_action);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":323
 *         return GetResultValue(self.action.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Action.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_action);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":336
 *         return action
 * 
 *     def __eq__(self, Action other):             # <<<<<<<<<<<<<<
 *         return self.action == other.action
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, 1, "other", 0))) __PYX_ERR(0, 336, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Action_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_6Action_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":337
 * 
 *     def __eq__(self, Action other):
 *         return self.action == other.action             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->action == __pyx_v_other->action)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":336
 *         return action
 * 
 *     def __eq__(self, Action other):             # <<<<<<<<<<<<<<
 *         return self.action == other.action
 * 
*/

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

/* "pyarrow/_flight.pyx":339
 *         return self.action == other.action
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.Action type={self.type!r} "
 *                 f"body=({self.body.size} bytes)>")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_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_7pyarrow_7_flight_6Action_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":340
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.Action type={self.type!r} "             # <<<<<<<<<<<<<<
 *                 f"body=({self.body.size} bytes)>")
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __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, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":341
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.Action type={self.type!r} "
 *                 f"body=({self.body.size} bytes)>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_body_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_Action_type;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_body;
  __pyx_t_4[3] = __pyx_t_1;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_bytes;

  /* "pyarrow/_flight.pyx":340
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.Action type={self.type!r} "             # <<<<<<<<<<<<<<
 *                 f"body=({self.body.size} bytes)>")
 * 
*/
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 28 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":339
 *         return self.action == other.action
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.Action type={self.type!r} "
 *                 f"body=({self.body.size} bytes)>")
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Action_10__reduce_cython__, "Action.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Action_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_6Action_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Action_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Action *__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.action cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_action_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.Action.__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.action cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Action_12__setstate_cython__, "Action.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Action_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Action_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.Action.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Action_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_Action *)__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_7pyarrow_7_flight_6Action_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Action *__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.action cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_action_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":350
 *     """A type of action that is executable on a Flight service."""
 * 
 *     def make_action(self, buf):             # <<<<<<<<<<<<<<
 *         """Create an Action with this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10ActionType_1make_action(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_7pyarrow_7_flight_10ActionType_make_action, "ActionType.make_action(self, buf)\n\nCreate an Action with this type.\n\nParameters\n----------\nbuf : obj\n    An Arrow buffer or Python bytes or bytes-like object.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_10ActionType_1make_action = {"make_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10ActionType_1make_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10ActionType_make_action};
static PyObject *__pyx_pw_7pyarrow_7_flight_10ActionType_1make_action(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_buf = 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("make_action (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_self,&__pyx_mstate_global->__pyx_n_u_buf,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, 350, __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, 350, __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, 350, __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, "make_action", 0) < (0)) __PYX_ERR(0, 350, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("make_action", 1, 2, 2, i); __PYX_ERR(0, 350, __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, 350, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 350, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_buf = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_action", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 350, __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("pyarrow._flight.ActionType.make_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10ActionType_make_action(__pyx_self, __pyx_v_self, __pyx_v_buf);

  /* 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_7pyarrow_7_flight_10ActionType_make_action(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_buf) {
  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("make_action", 0);

  /* "pyarrow/_flight.pyx":358
 *             An Arrow buffer or Python bytes or bytes-like object.
 *         """
 *         return Action(self.type, buf)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_v_buf};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_callargs+__pyx_t_4, (3-__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, 358, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":350
 *     """A type of action that is executable on a Flight service."""
 * 
 *     def make_action(self, buf):             # <<<<<<<<<<<<<<
 *         """Create an Action with this type.
 * 
*/

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

/* "pyarrow/_flight.pyx":366
 *         unique_ptr[CFlightResult] result
 * 
 *     def __init__(self, buf):             # <<<<<<<<<<<<<<
 *         """Create a new result.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Result___init__, "Create a new result.\n\n        Parameters\n        ----------\n        buf : Buffer or bytes-like object\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_6Result___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_buf = 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_buf,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, 366, __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, 366, __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, 366, __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, 366, __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, 366, __pyx_L3_error)
    }
    __pyx_v_buf = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 366, __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("pyarrow._flight.Result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Result___init__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self), __pyx_v_buf);

  /* 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_7pyarrow_7_flight_6Result___init__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self, PyObject *__pyx_v_buf) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":373
 *         buf : Buffer or bytes-like object
 *         """
 *         self.result.reset(new CFlightResult())             # <<<<<<<<<<<<<<
 *         self.result.get().body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
*/
  __pyx_v_self->result.reset(new  arrow::flight::Result());

  /* "pyarrow/_flight.pyx":374
 *         """
 *         self.result.reset(new CFlightResult())
 *         self.result.get().body = pyarrow_unwrap_buffer(as_buffer(buf))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __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_v_buf};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->result.get()->body = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":366
 *         unique_ptr[CFlightResult] result
 * 
 *     def __init__(self, buf):             # <<<<<<<<<<<<<<
 *         """Create a new result.
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":376
 *         self.result.get().body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def body(self):
 *         """Get the Buffer containing the result."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_4body_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_4body_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_7pyarrow_7_flight_6Result_4body___get__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_4body___get__(struct __pyx_obj_7pyarrow_7_flight_Result *__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);

  /* "pyarrow/_flight.pyx":379
 *     def body(self):
 *         """Get the Buffer containing the result."""
 *         return pyarrow_wrap_buffer(self.result.get().body)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_self->result.get()->body); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":376
 *         self.result.get().body = pyarrow_unwrap_buffer(as_buffer(buf))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def body(self):
 *         """Get the Buffer containing the result."""
*/

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

/* "pyarrow/_flight.pyx":381
 *         return pyarrow_wrap_buffer(self.result.get().body)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Result_2serialize, "Result.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Result_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Result_2serialize(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_2serialize(struct __pyx_obj_7pyarrow_7_flight_Result *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":388
 * 
 *         """
 *         return GetResultValue(self.result.get().SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->result.get()->SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":381
 *         return pyarrow_wrap_buffer(self.result.get().body)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.Result.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":390
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_5deserialize(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_7pyarrow_7_flight_6Result_4deserialize, "Result.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Result_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 390, __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, 390, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 390, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 390, __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, 390, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 390, __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("pyarrow._flight.Result.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Result_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_6Result_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::Result __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":398
 * 
 *         """
 *         cdef Result result = Result.__new__(Result)             # <<<<<<<<<<<<<<
 *         result.result.reset(new CFlightResult(GetResultValue(
 *             CFlightResult.Deserialize(tobytes(serialized)))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Result(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":400
 *         cdef Result result = Result.__new__(Result)
 *         result.result.reset(new CFlightResult(GetResultValue(
 *             CFlightResult.Deserialize(tobytes(serialized)))))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":399
 *         """
 *         cdef Result result = Result.__new__(Result)
 *         result.result.reset(new CFlightResult(GetResultValue(             # <<<<<<<<<<<<<<
 *             CFlightResult.Deserialize(tobytes(serialized)))))
 *         return result
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::Result>( arrow::flight::Result::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L1_error)
  __pyx_v_result->result.reset(new  arrow::flight::Result(__pyx_t_6));

  /* "pyarrow/_flight.pyx":401
 *         result.result.reset(new CFlightResult(GetResultValue(
 *             CFlightResult.Deserialize(tobytes(serialized)))))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, Result other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":390
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Result.deserialize", __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;
}

/* "pyarrow/_flight.pyx":403
 *         return result
 * 
 *     def __eq__(self, Result other):             # <<<<<<<<<<<<<<
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, 1, "other", 0))) __PYX_ERR(0, 403, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Result_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_6Result_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Result *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":404
 * 
 *     def __eq__(self, Result other):
 *         return deref(self.result.get()) == deref(other.result.get())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((*__pyx_v_self->result.get()) == (*__pyx_v_other->result.get()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":403
 *         return result
 * 
 *     def __eq__(self, Result other):             # <<<<<<<<<<<<<<
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
*/

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

/* "pyarrow/_flight.pyx":406
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.Result body=({self.body.size} bytes)>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_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_7pyarrow_7_flight_6Result_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Result *__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);

  /* "pyarrow/_flight.pyx":407
 * 
 *     def __repr__(self):
 *         return f"<pyarrow.flight.Result body=({self.body.size} bytes)>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_body_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_Result_body;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_bytes;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":406
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.Result body=({self.body.size} bytes)>"
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Result_10__reduce_cython__, "Result.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Result_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_6Result_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Result_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Result *__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.result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.Result.__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.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Result_12__setstate_cython__, "Result.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Result_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Result_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.Result.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Result_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_Result *)__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_7pyarrow_7_flight_6Result_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Result *__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.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":415
 *         unique_ptr[CBasicAuth] basic_auth
 * 
 *     def __init__(self, username=None, password=None):             # <<<<<<<<<<<<<<
 *         """Create a new basic auth object.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_9BasicAuth_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_9BasicAuth___init__, "Create a new basic auth object.\n\n        Parameters\n        ----------\n        username : string\n        password : string\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_9BasicAuth___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_9BasicAuth_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_username = 0;
  PyObject *__pyx_v_password = 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_username,&__pyx_mstate_global->__pyx_n_u_password,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, 415, __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, 415, __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, 415, __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, 415, __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_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 415, __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, 415, __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_username = values[0];
    __pyx_v_password = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 415, __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("pyarrow._flight.BasicAuth.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_9BasicAuth___init__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self), __pyx_v_username, __pyx_v_password);

  /* 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_7pyarrow_7_flight_9BasicAuth___init__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password) {
  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::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":423
 *         password : string
 *         """
 *         self.basic_auth.reset(new CBasicAuth())             # <<<<<<<<<<<<<<
 *         if username:
 *             self.basic_auth.get().username = tobytes(username)
*/
  __pyx_v_self->basic_auth.reset(new  arrow::flight::BasicAuth());

  /* "pyarrow/_flight.pyx":424
 *         """
 *         self.basic_auth.reset(new CBasicAuth())
 *         if username:             # <<<<<<<<<<<<<<
 *             self.basic_auth.get().username = tobytes(username)
 *         if password:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_username); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 424, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":425
 *         self.basic_auth.reset(new CBasicAuth())
 *         if username:
 *             self.basic_auth.get().username = tobytes(username)             # <<<<<<<<<<<<<<
 *         if password:
 *             self.basic_auth.get().password = tobytes(password)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __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_v_username};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 425, __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, 425, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->basic_auth.get()->username = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "pyarrow/_flight.pyx":424
 *         """
 *         self.basic_auth.reset(new CBasicAuth())
 *         if username:             # <<<<<<<<<<<<<<
 *             self.basic_auth.get().username = tobytes(username)
 *         if password:
*/
  }

  /* "pyarrow/_flight.pyx":426
 *         if username:
 *             self.basic_auth.get().username = tobytes(username)
 *         if password:             # <<<<<<<<<<<<<<
 *             self.basic_auth.get().password = tobytes(password)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_password); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 426, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":427
 *             self.basic_auth.get().username = tobytes(username)
 *         if password:
 *             self.basic_auth.get().password = tobytes(password)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __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_v_password};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 427, __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, 427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->basic_auth.get()->password = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

    /* "pyarrow/_flight.pyx":426
 *         if username:
 *             self.basic_auth.get().username = tobytes(username)
 *         if password:             # <<<<<<<<<<<<<<
 *             self.basic_auth.get().password = tobytes(password)
 * 
*/
  }

  /* "pyarrow/_flight.pyx":415
 *         unique_ptr[CBasicAuth] basic_auth
 * 
 *     def __init__(self, username=None, password=None):             # <<<<<<<<<<<<<<
 *         """Create a new basic auth object.
 * 
*/

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

/* "pyarrow/_flight.pyx":429
 *             self.basic_auth.get().password = tobytes(password)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def username(self):
 *         """Get the username."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_8username_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_8username_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_7pyarrow_7_flight_9BasicAuth_8username___get__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8username___get__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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);

  /* "pyarrow/_flight.pyx":432
 *     def username(self):
 *         """Get the username."""
 *         return self.basic_auth.get().username             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->basic_auth.get()->username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":429
 *             self.basic_auth.get().password = tobytes(password)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def username(self):
 *         """Get the username."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.BasicAuth.username.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":434
 *         return self.basic_auth.get().username
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self):
 *         """Get the password."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_8password_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_8password_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_7pyarrow_7_flight_9BasicAuth_8password___get__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8password___get__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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);

  /* "pyarrow/_flight.pyx":437
 *     def password(self):
 *         """Get the password."""
 *         return self.basic_auth.get().password             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->basic_auth.get()->password); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":434
 *         return self.basic_auth.get().username
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def password(self):
 *         """Get the password."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.BasicAuth.password.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":439
 *         return self.basic_auth.get().password
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def deserialize(serialized):
 *         auth = BasicAuth()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_3deserialize(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_7pyarrow_7_flight_9BasicAuth_2deserialize, "BasicAuth.deserialize(serialized)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_9BasicAuth_3deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_3deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_2deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_3deserialize(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_serialized = 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("deserialize (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_serialized,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, 439, __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, 439, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 439, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 439, __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, 439, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 439, __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("pyarrow._flight.BasicAuth.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_9BasicAuth_2deserialize(__pyx_v_serialized);

  /* 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_7pyarrow_7_flight_9BasicAuth_2deserialize(PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_auth = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
   arrow::flight::BasicAuth __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":441
 *     @staticmethod
 *     def deserialize(serialized):
 *         auth = BasicAuth()             # <<<<<<<<<<<<<<
 *         auth.basic_auth.reset(new CBasicAuth(GetResultValue(
 *             CBasicAuth.Deserialize(tobytes(serialized)))))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_auth = ((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":443
 *         auth = BasicAuth()
 *         auth.basic_auth.reset(new CBasicAuth(GetResultValue(
 *             CBasicAuth.Deserialize(tobytes(serialized)))))             # <<<<<<<<<<<<<<
 *         return auth
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = 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_3 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__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, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":442
 *     def deserialize(serialized):
 *         auth = BasicAuth()
 *         auth.basic_auth.reset(new CBasicAuth(GetResultValue(             # <<<<<<<<<<<<<<
 *             CBasicAuth.Deserialize(tobytes(serialized)))))
 *         return auth
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::BasicAuth>( arrow::flight::BasicAuth::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
  __pyx_v_auth->basic_auth.reset(new  arrow::flight::BasicAuth(__pyx_t_6));

  /* "pyarrow/_flight.pyx":444
 *         auth.basic_auth.reset(new CBasicAuth(GetResultValue(
 *             CBasicAuth.Deserialize(tobytes(serialized)))))
 *         return auth             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_auth);
  __pyx_r = ((PyObject *)__pyx_v_auth);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":439
 *         return self.basic_auth.get().password
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def deserialize(serialized):
 *         auth = BasicAuth()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.BasicAuth.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_auth);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":446
 *         return auth
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         return GetResultValue(self.basic_auth.get().SerializeToString())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_5serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_9BasicAuth_4serialize, "BasicAuth.serialize(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_9BasicAuth_5serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_5serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_4serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_5serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_9BasicAuth_4serialize(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_4serialize(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":447
 * 
 *     def serialize(self):
 *         return GetResultValue(self.basic_auth.get().SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, BasicAuth other):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->basic_auth.get()->SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":446
 *         return auth
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         return GetResultValue(self.basic_auth.get().SerializeToString())
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.BasicAuth.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":449
 *         return GetResultValue(self.basic_auth.get().SerializeToString())
 * 
 *     def __eq__(self, BasicAuth other):             # <<<<<<<<<<<<<<
 *         return deref(self.basic_auth.get()) == deref(other.basic_auth.get())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, 1, "other", 0))) __PYX_ERR(0, 449, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_9BasicAuth_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_9BasicAuth_6__eq__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":450
 * 
 *     def __eq__(self, BasicAuth other):
 *         return deref(self.basic_auth.get()) == deref(other.basic_auth.get())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((*__pyx_v_self->basic_auth.get()) == (*__pyx_v_other->basic_auth.get()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":449
 *         return GetResultValue(self.basic_auth.get().SerializeToString())
 * 
 *     def __eq__(self, BasicAuth other):             # <<<<<<<<<<<<<<
 *         return deref(self.basic_auth.get()) == deref(other.basic_auth.get())
 * 
*/

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

/* "pyarrow/_flight.pyx":452
 *         return deref(self.basic_auth.get()) == deref(other.basic_auth.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.BasicAuth username={self.username!r} "
 *                 "password=(redacted)>")
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_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_7pyarrow_7_flight_9BasicAuth_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_8__repr__(struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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);

  /* "pyarrow/_flight.pyx":453
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.BasicAuth username={self.username!r} "             # <<<<<<<<<<<<<<
 *                 "password=(redacted)>")
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_username); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __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_pyarrow_flight_BasicAuth_userna;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_password_redacted;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 21, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __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;

  /* "pyarrow/_flight.pyx":452
 *         return deref(self.basic_auth.get()) == deref(other.basic_auth.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.BasicAuth username={self.username!r} "
 *                 "password=(redacted)>")
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__, "BasicAuth.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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.basic_auth cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.basic_auth cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_basic_auth_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.BasicAuth.__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.basic_auth cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.basic_auth cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__, "BasicAuth.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.BasicAuth.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)__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_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_BasicAuth *__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.basic_auth cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.basic_auth cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_basic_auth_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":495
 * 
 * 
 * cdef wrap_flight_method(CFlightMethod method):             # <<<<<<<<<<<<<<
 *     if method == CFlightMethodHandshake:
 *         return FlightMethod.HANDSHAKE
*/

static PyObject *__pyx_f_7pyarrow_7_flight_wrap_flight_method( arrow::flight::FlightMethod __pyx_v_method) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap_flight_method", 0);

  /* "pyarrow/_flight.pyx":496
 * 
 * cdef wrap_flight_method(CFlightMethod method):
 *     if method == CFlightMethodHandshake:             # <<<<<<<<<<<<<<
 *         return FlightMethod.HANDSHAKE
 *     elif method == CFlightMethodListFlights:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::Handshake);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":497
 * cdef wrap_flight_method(CFlightMethod method):
 *     if method == CFlightMethodHandshake:
 *         return FlightMethod.HANDSHAKE             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodListFlights:
 *         return FlightMethod.LIST_FLIGHTS
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_HANDSHAKE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __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;

    /* "pyarrow/_flight.pyx":496
 * 
 * cdef wrap_flight_method(CFlightMethod method):
 *     if method == CFlightMethodHandshake:             # <<<<<<<<<<<<<<
 *         return FlightMethod.HANDSHAKE
 *     elif method == CFlightMethodListFlights:
*/
  }

  /* "pyarrow/_flight.pyx":498
 *     if method == CFlightMethodHandshake:
 *         return FlightMethod.HANDSHAKE
 *     elif method == CFlightMethodListFlights:             # <<<<<<<<<<<<<<
 *         return FlightMethod.LIST_FLIGHTS
 *     elif method == CFlightMethodGetFlightInfo:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::ListFlights);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":499
 *         return FlightMethod.HANDSHAKE
 *     elif method == CFlightMethodListFlights:
 *         return FlightMethod.LIST_FLIGHTS             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodGetFlightInfo:
 *         return FlightMethod.GET_FLIGHT_INFO
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LIST_FLIGHTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":498
 *     if method == CFlightMethodHandshake:
 *         return FlightMethod.HANDSHAKE
 *     elif method == CFlightMethodListFlights:             # <<<<<<<<<<<<<<
 *         return FlightMethod.LIST_FLIGHTS
 *     elif method == CFlightMethodGetFlightInfo:
*/
  }

  /* "pyarrow/_flight.pyx":500
 *     elif method == CFlightMethodListFlights:
 *         return FlightMethod.LIST_FLIGHTS
 *     elif method == CFlightMethodGetFlightInfo:             # <<<<<<<<<<<<<<
 *         return FlightMethod.GET_FLIGHT_INFO
 *     elif method == CFlightMethodGetSchema:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::GetFlightInfo);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":501
 *         return FlightMethod.LIST_FLIGHTS
 *     elif method == CFlightMethodGetFlightInfo:
 *         return FlightMethod.GET_FLIGHT_INFO             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodGetSchema:
 *         return FlightMethod.GET_SCHEMA
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_GET_FLIGHT_INFO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __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;

    /* "pyarrow/_flight.pyx":500
 *     elif method == CFlightMethodListFlights:
 *         return FlightMethod.LIST_FLIGHTS
 *     elif method == CFlightMethodGetFlightInfo:             # <<<<<<<<<<<<<<
 *         return FlightMethod.GET_FLIGHT_INFO
 *     elif method == CFlightMethodGetSchema:
*/
  }

  /* "pyarrow/_flight.pyx":502
 *     elif method == CFlightMethodGetFlightInfo:
 *         return FlightMethod.GET_FLIGHT_INFO
 *     elif method == CFlightMethodGetSchema:             # <<<<<<<<<<<<<<
 *         return FlightMethod.GET_SCHEMA
 *     elif method == CFlightMethodDoGet:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::GetSchema);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":503
 *         return FlightMethod.GET_FLIGHT_INFO
 *     elif method == CFlightMethodGetSchema:
 *         return FlightMethod.GET_SCHEMA             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodDoGet:
 *         return FlightMethod.DO_GET
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_GET_SCHEMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":502
 *     elif method == CFlightMethodGetFlightInfo:
 *         return FlightMethod.GET_FLIGHT_INFO
 *     elif method == CFlightMethodGetSchema:             # <<<<<<<<<<<<<<
 *         return FlightMethod.GET_SCHEMA
 *     elif method == CFlightMethodDoGet:
*/
  }

  /* "pyarrow/_flight.pyx":504
 *     elif method == CFlightMethodGetSchema:
 *         return FlightMethod.GET_SCHEMA
 *     elif method == CFlightMethodDoGet:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_GET
 *     elif method == CFlightMethodDoPut:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::DoGet);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":505
 *         return FlightMethod.GET_SCHEMA
 *     elif method == CFlightMethodDoGet:
 *         return FlightMethod.DO_GET             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodDoPut:
 *         return FlightMethod.DO_PUT
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DO_GET); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __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;

    /* "pyarrow/_flight.pyx":504
 *     elif method == CFlightMethodGetSchema:
 *         return FlightMethod.GET_SCHEMA
 *     elif method == CFlightMethodDoGet:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_GET
 *     elif method == CFlightMethodDoPut:
*/
  }

  /* "pyarrow/_flight.pyx":506
 *     elif method == CFlightMethodDoGet:
 *         return FlightMethod.DO_GET
 *     elif method == CFlightMethodDoPut:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_PUT
 *     elif method == CFlightMethodDoAction:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::DoPut);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":507
 *         return FlightMethod.DO_GET
 *     elif method == CFlightMethodDoPut:
 *         return FlightMethod.DO_PUT             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodDoAction:
 *         return FlightMethod.DO_ACTION
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DO_PUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":506
 *     elif method == CFlightMethodDoGet:
 *         return FlightMethod.DO_GET
 *     elif method == CFlightMethodDoPut:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_PUT
 *     elif method == CFlightMethodDoAction:
*/
  }

  /* "pyarrow/_flight.pyx":508
 *     elif method == CFlightMethodDoPut:
 *         return FlightMethod.DO_PUT
 *     elif method == CFlightMethodDoAction:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_ACTION
 *     elif method == CFlightMethodListActions:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::DoAction);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":509
 *         return FlightMethod.DO_PUT
 *     elif method == CFlightMethodDoAction:
 *         return FlightMethod.DO_ACTION             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodListActions:
 *         return FlightMethod.LIST_ACTIONS
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DO_ACTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __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;

    /* "pyarrow/_flight.pyx":508
 *     elif method == CFlightMethodDoPut:
 *         return FlightMethod.DO_PUT
 *     elif method == CFlightMethodDoAction:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_ACTION
 *     elif method == CFlightMethodListActions:
*/
  }

  /* "pyarrow/_flight.pyx":510
 *     elif method == CFlightMethodDoAction:
 *         return FlightMethod.DO_ACTION
 *     elif method == CFlightMethodListActions:             # <<<<<<<<<<<<<<
 *         return FlightMethod.LIST_ACTIONS
 *     elif method == CFlightMethodDoExchange:
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::ListActions);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":511
 *         return FlightMethod.DO_ACTION
 *     elif method == CFlightMethodListActions:
 *         return FlightMethod.LIST_ACTIONS             # <<<<<<<<<<<<<<
 *     elif method == CFlightMethodDoExchange:
 *         return FlightMethod.DO_EXCHANGE
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_LIST_ACTIONS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":510
 *     elif method == CFlightMethodDoAction:
 *         return FlightMethod.DO_ACTION
 *     elif method == CFlightMethodListActions:             # <<<<<<<<<<<<<<
 *         return FlightMethod.LIST_ACTIONS
 *     elif method == CFlightMethodDoExchange:
*/
  }

  /* "pyarrow/_flight.pyx":512
 *     elif method == CFlightMethodListActions:
 *         return FlightMethod.LIST_ACTIONS
 *     elif method == CFlightMethodDoExchange:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_EXCHANGE
 *     return FlightMethod.INVALID
*/
  __pyx_t_1 = (__pyx_v_method ==  arrow::flight::FlightMethod::DoExchange);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":513
 *         return FlightMethod.LIST_ACTIONS
 *     elif method == CFlightMethodDoExchange:
 *         return FlightMethod.DO_EXCHANGE             # <<<<<<<<<<<<<<
 *     return FlightMethod.INVALID
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DO_EXCHANGE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __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;

    /* "pyarrow/_flight.pyx":512
 *     elif method == CFlightMethodListActions:
 *         return FlightMethod.LIST_ACTIONS
 *     elif method == CFlightMethodDoExchange:             # <<<<<<<<<<<<<<
 *         return FlightMethod.DO_EXCHANGE
 *     return FlightMethod.INVALID
*/
  }

  /* "pyarrow/_flight.pyx":514
 *     elif method == CFlightMethodDoExchange:
 *         return FlightMethod.DO_EXCHANGE
 *     return FlightMethod.INVALID             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FlightMethod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_INVALID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":495
 * 
 * 
 * cdef wrap_flight_method(CFlightMethod method):             # <<<<<<<<<<<<<<
 *     if method == CFlightMethodHandshake:
 *         return FlightMethod.HANDSHAKE
*/

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

/* "pyarrow/_flight.pyx":522
 *         CFlightDescriptor descriptor
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError(f"Do not call {self.__class__.__name__}'s constructor directly, use "
 *                         "`pyarrow.flight.FlightDescriptor.for_{path,command}` "
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_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_7pyarrow_7_flight_16FlightDescriptor___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

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

  /* "pyarrow/_flight.pyx":523
 * 
 *     def __init__(self):
 *         raise TypeError(f"Do not call {self.__class__.__name__}'s constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.flight.FlightDescriptor.for_{path,command}` "
 *                         "function instead.")
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_Do_not_call;
  __pyx_t_5[1] = __pyx_t_3;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_s_constructor_directly_use_pyar;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 99, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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, 523, __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, 523, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":522
 *         CFlightDescriptor descriptor
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError(f"Do not call {self.__class__.__name__}'s constructor directly, use "
 *                         "`pyarrow.flight.FlightDescriptor.for_{path,command}` "
*/

  /* 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("pyarrow._flight.FlightDescriptor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":527
 *                         "function instead.")
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_path(*path):
 *         """Create a FlightDescriptor for a resource path."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_3for_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDescriptor_2for_path, "FlightDescriptor.for_path(*path)\n\nCreate a FlightDescriptor for a resource path.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_3for_path = {"for_path", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_3for_path, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_2for_path};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_3for_path(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("for_path (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("for_path", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_path = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_2for_path(__pyx_self, __pyx_v_path);

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_2for_path(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_result = 0;
  PyObject *__pyx_7genexpr__pyx_v_p = 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  std::vector<std::string>  __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("for_path", 0);

  /* "pyarrow/_flight.pyx":531
 *         """Create a FlightDescriptor for a resource path."""
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *         result.descriptor.type = CDescriptorTypePath
 *         result.descriptor.path = [tobytes(p) for p in path]
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":532
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor.type = CDescriptorTypePath             # <<<<<<<<<<<<<<
 *         result.descriptor.path = [tobytes(p) for p in path]
 *         return result
*/
  __pyx_v_result->descriptor.type =  arrow::flight::FlightDescriptor::PATH;

  /* "pyarrow/_flight.pyx":533
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor.type = CDescriptorTypePath
 *         result.descriptor.path = [tobytes(p) for p in path]             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_path; __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, 533, __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, 533, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_p, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 533, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 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_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_7genexpr__pyx_v_p};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__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_4)) __PYX_ERR(0, 533, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 533, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_p); __pyx_7genexpr__pyx_v_p = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_p); __pyx_7genexpr__pyx_v_p = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result->descriptor.path = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pyarrow/_flight.pyx":534
 *         result.descriptor.type = CDescriptorTypePath
 *         result.descriptor.path = [tobytes(p) for p in path]
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":527
 *                         "function instead.")
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_path(*path):
 *         """Create a FlightDescriptor for a resource path."""
*/

  /* 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.for_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":536
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_command(command):
 *         """Create a FlightDescriptor for an opaque command."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_5for_command(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_7pyarrow_7_flight_16FlightDescriptor_4for_command, "FlightDescriptor.for_command(command)\n\nCreate a FlightDescriptor for an opaque command.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_5for_command = {"for_command", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_5for_command, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_4for_command};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_5for_command(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_command = 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("for_command (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_command,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, 536, __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, 536, __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, "for_command", 0) < (0)) __PYX_ERR(0, 536, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("for_command", 1, 1, 1, i); __PYX_ERR(0, 536, __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, 536, __pyx_L3_error)
    }
    __pyx_v_command = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("for_command", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 536, __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("pyarrow._flight.FlightDescriptor.for_command", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_4for_command(__pyx_v_command);

  /* 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_7pyarrow_7_flight_16FlightDescriptor_4for_command(PyObject *__pyx_v_command) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("for_command", 0);

  /* "pyarrow/_flight.pyx":540
 *         """Create a FlightDescriptor for an opaque command."""
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *         result.descriptor.type = CDescriptorTypeCmd
 *         result.descriptor.cmd = tobytes(command)
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":541
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor.type = CDescriptorTypeCmd             # <<<<<<<<<<<<<<
 *         result.descriptor.cmd = tobytes(command)
 *         return result
*/
  __pyx_v_result->descriptor.type =  arrow::flight::FlightDescriptor::CMD;

  /* "pyarrow/_flight.pyx":542
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor.type = CDescriptorTypeCmd
 *         result.descriptor.cmd = tobytes(command)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __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_v_command};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result->descriptor.cmd = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":543
 *         result.descriptor.type = CDescriptorTypeCmd
 *         result.descriptor.cmd = tobytes(command)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":536
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_command(command):
 *         """Create a FlightDescriptor for an opaque command."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.for_command", __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;
}

/* "pyarrow/_flight.pyx":545
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def descriptor_type(self):
 *         """Get the type of this descriptor."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type_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_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__get__", 0);

  /* "pyarrow/_flight.pyx":548
 *     def descriptor_type(self):
 *         """Get the type of this descriptor."""
 *         if self.descriptor.type == CDescriptorTypeUnknown:             # <<<<<<<<<<<<<<
 *             return DescriptorType.UNKNOWN
 *         elif self.descriptor.type == CDescriptorTypePath:
*/
  __pyx_t_1 = (__pyx_v_self->descriptor.type ==  arrow::flight::FlightDescriptor::UNKNOWN);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":549
 *         """Get the type of this descriptor."""
 *         if self.descriptor.type == CDescriptorTypeUnknown:
 *             return DescriptorType.UNKNOWN             # <<<<<<<<<<<<<<
 *         elif self.descriptor.type == CDescriptorTypePath:
 *             return DescriptorType.PATH
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UNKNOWN); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __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;

    /* "pyarrow/_flight.pyx":548
 *     def descriptor_type(self):
 *         """Get the type of this descriptor."""
 *         if self.descriptor.type == CDescriptorTypeUnknown:             # <<<<<<<<<<<<<<
 *             return DescriptorType.UNKNOWN
 *         elif self.descriptor.type == CDescriptorTypePath:
*/
  }

  /* "pyarrow/_flight.pyx":550
 *         if self.descriptor.type == CDescriptorTypeUnknown:
 *             return DescriptorType.UNKNOWN
 *         elif self.descriptor.type == CDescriptorTypePath:             # <<<<<<<<<<<<<<
 *             return DescriptorType.PATH
 *         elif self.descriptor.type == CDescriptorTypeCmd:
*/
  __pyx_t_1 = (__pyx_v_self->descriptor.type ==  arrow::flight::FlightDescriptor::PATH);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":551
 *             return DescriptorType.UNKNOWN
 *         elif self.descriptor.type == CDescriptorTypePath:
 *             return DescriptorType.PATH             # <<<<<<<<<<<<<<
 *         elif self.descriptor.type == CDescriptorTypeCmd:
 *             return DescriptorType.CMD
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PATH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":550
 *         if self.descriptor.type == CDescriptorTypeUnknown:
 *             return DescriptorType.UNKNOWN
 *         elif self.descriptor.type == CDescriptorTypePath:             # <<<<<<<<<<<<<<
 *             return DescriptorType.PATH
 *         elif self.descriptor.type == CDescriptorTypeCmd:
*/
  }

  /* "pyarrow/_flight.pyx":552
 *         elif self.descriptor.type == CDescriptorTypePath:
 *             return DescriptorType.PATH
 *         elif self.descriptor.type == CDescriptorTypeCmd:             # <<<<<<<<<<<<<<
 *             return DescriptorType.CMD
 *         raise RuntimeError("Invalid descriptor type!")
*/
  __pyx_t_1 = (__pyx_v_self->descriptor.type ==  arrow::flight::FlightDescriptor::CMD);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":553
 *             return DescriptorType.PATH
 *         elif self.descriptor.type == CDescriptorTypeCmd:
 *             return DescriptorType.CMD             # <<<<<<<<<<<<<<
 *         raise RuntimeError("Invalid descriptor type!")
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CMD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __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;

    /* "pyarrow/_flight.pyx":552
 *         elif self.descriptor.type == CDescriptorTypePath:
 *             return DescriptorType.PATH
 *         elif self.descriptor.type == CDescriptorTypeCmd:             # <<<<<<<<<<<<<<
 *             return DescriptorType.CMD
 *         raise RuntimeError("Invalid descriptor type!")
*/
  }

  /* "pyarrow/_flight.pyx":554
 *         elif self.descriptor.type == CDescriptorTypeCmd:
 *             return DescriptorType.CMD
 *         raise RuntimeError("Invalid descriptor type!")             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Invalid_descriptor_type};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __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;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __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, 554, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":545
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def descriptor_type(self):
 *         """Get the type of this descriptor."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.descriptor_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":556
 *         raise RuntimeError("Invalid descriptor type!")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command(self):
 *         """Get the command for this descriptor."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7command_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7command_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_7pyarrow_7_flight_16FlightDescriptor_7command___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_7command___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":559
 *     def command(self):
 *         """Get the command for this descriptor."""
 *         if self.descriptor_type != DescriptorType.CMD:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.descriptor.cmd
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descriptor_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CMD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":560
 *         """Get the command for this descriptor."""
 *         if self.descriptor_type != DescriptorType.CMD:
 *             return None             # <<<<<<<<<<<<<<
 *         return self.descriptor.cmd
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":559
 *     def command(self):
 *         """Get the command for this descriptor."""
 *         if self.descriptor_type != DescriptorType.CMD:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.descriptor.cmd
*/
  }

  /* "pyarrow/_flight.pyx":561
 *         if self.descriptor_type != DescriptorType.CMD:
 *             return None
 *         return self.descriptor.cmd             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->descriptor.cmd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":556
 *         raise RuntimeError("Invalid descriptor type!")
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def command(self):
 *         """Get the command for this descriptor."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.command.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":563
 *         return self.descriptor.cmd
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def path(self):
 *         """Get the path for this descriptor."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_4path_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_7pyarrow_7_flight_16FlightDescriptor_4path___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_4path___get__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":566
 *     def path(self):
 *         """Get the path for this descriptor."""
 *         if self.descriptor_type != DescriptorType.PATH:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.descriptor.path
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descriptor_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":567
 *         """Get the path for this descriptor."""
 *         if self.descriptor_type != DescriptorType.PATH:
 *             return None             # <<<<<<<<<<<<<<
 *         return self.descriptor.path
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":566
 *     def path(self):
 *         """Get the path for this descriptor."""
 *         if self.descriptor_type != DescriptorType.PATH:             # <<<<<<<<<<<<<<
 *             return None
 *         return self.descriptor.path
*/
  }

  /* "pyarrow/_flight.pyx":568
 *         if self.descriptor_type != DescriptorType.PATH:
 *             return None
 *         return self.descriptor.path             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->descriptor.path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":563
 *         return self.descriptor.cmd
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def path(self):
 *         """Get the path for this descriptor."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.path.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":570
 *         return self.descriptor.path
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.descriptor_type == DescriptorType.PATH:
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_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_7pyarrow_7_flight_16FlightDescriptor_6__repr__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_6__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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_t_4;
  PyObject *__pyx_t_5[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":571
 * 
 *     def __repr__(self):
 *         if self.descriptor_type == DescriptorType.PATH:             # <<<<<<<<<<<<<<
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
 *         elif self.descriptor_type == DescriptorType.CMD:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descriptor_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_PATH); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":572
 *     def __repr__(self):
 *         if self.descriptor_type == DescriptorType.PATH:
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"             # <<<<<<<<<<<<<<
 *         elif self.descriptor_type == DescriptorType.CMD:
 *             return f"<pyarrow.flight.FlightDescriptor cmd={self.command!r}>"
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __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, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightDescriptor;
    __pyx_t_5[1] = __pyx_t_3;
    __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u__6;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":571
 * 
 *     def __repr__(self):
 *         if self.descriptor_type == DescriptorType.PATH:             # <<<<<<<<<<<<<<
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
 *         elif self.descriptor_type == DescriptorType.CMD:
*/
  }

  /* "pyarrow/_flight.pyx":573
 *         if self.descriptor_type == DescriptorType.PATH:
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
 *         elif self.descriptor_type == DescriptorType.CMD:             # <<<<<<<<<<<<<<
 *             return f"<pyarrow.flight.FlightDescriptor cmd={self.command!r}>"
 *         else:
*/
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descriptor_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_DescriptorType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CMD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":574
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
 *         elif self.descriptor_type == DescriptorType.CMD:
 *             return f"<pyarrow.flight.FlightDescriptor cmd={self.command!r}>"             # <<<<<<<<<<<<<<
 *         else:
 *             return "<pyarrow.flight.FlightDescriptor UNKNOWN>"
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_command); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightDescriptor_2;
    __pyx_t_5[1] = __pyx_t_1;
    __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u__6;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":573
 *         if self.descriptor_type == DescriptorType.PATH:
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
 *         elif self.descriptor_type == DescriptorType.CMD:             # <<<<<<<<<<<<<<
 *             return f"<pyarrow.flight.FlightDescriptor cmd={self.command!r}>"
 *         else:
*/
  }

  /* "pyarrow/_flight.pyx":576
 *             return f"<pyarrow.flight.FlightDescriptor cmd={self.command!r}>"
 *         else:
 *             return "<pyarrow.flight.FlightDescriptor UNKNOWN>"             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightDescriptor_3);
    __pyx_r = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightDescriptor_3;
    goto __pyx_L0;
  }

  /* "pyarrow/_flight.pyx":570
 *         return self.descriptor.path
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if self.descriptor_type == DescriptorType.PATH:
 *             return f"<pyarrow.flight.FlightDescriptor path={self.path!r}>"
*/

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

/* "pyarrow/_flight.pyx":578
 *             return "<pyarrow.flight.FlightDescriptor UNKNOWN>"
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CFlightDescriptor unwrap(descriptor) except *:
 *         if not isinstance(descriptor, FlightDescriptor):
*/

static  arrow::flight::FlightDescriptor __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(PyObject *__pyx_v_descriptor) {
   arrow::flight::FlightDescriptor __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[3];
  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("unwrap", 0);

  /* "pyarrow/_flight.pyx":580
 *     @staticmethod
 *     cdef CFlightDescriptor unwrap(descriptor) except *:
 *         if not isinstance(descriptor, FlightDescriptor):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f"Must provide a FlightDescriptor, not '{type(descriptor)}'")
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_descriptor, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":581
 *     cdef CFlightDescriptor unwrap(descriptor) except *:
 *         if not isinstance(descriptor, FlightDescriptor):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 f"Must provide a FlightDescriptor, not '{type(descriptor)}'")
 *         return (<FlightDescriptor> descriptor).descriptor
*/
    __pyx_t_4 = NULL;

    /* "pyarrow/_flight.pyx":582
 *         if not isinstance(descriptor, FlightDescriptor):
 *             raise TypeError(
 *                 f"Must provide a FlightDescriptor, not '{type(descriptor)}'")             # <<<<<<<<<<<<<<
 *         return (<FlightDescriptor> descriptor).descriptor
 * 
*/
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_descriptor)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Must_provide_a_FlightDescriptor;
    __pyx_t_6[1] = __pyx_t_5;
    __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__3;
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __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, 581, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":580
 *     @staticmethod
 *     cdef CFlightDescriptor unwrap(descriptor) except *:
 *         if not isinstance(descriptor, FlightDescriptor):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f"Must provide a FlightDescriptor, not '{type(descriptor)}'")
*/
  }

  /* "pyarrow/_flight.pyx":583
 *             raise TypeError(
 *                 f"Must provide a FlightDescriptor, not '{type(descriptor)}'")
 *         return (<FlightDescriptor> descriptor).descriptor             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __pyx_r = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_descriptor)->descriptor;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":578
 *             return "<pyarrow.flight.FlightDescriptor UNKNOWN>"
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CFlightDescriptor unwrap(descriptor) except *:
 *         if not isinstance(descriptor, FlightDescriptor):
*/

  /* 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_7);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.unwrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":585
 *         return (<FlightDescriptor> descriptor).descriptor
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_9serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDescriptor_8serialize, "FlightDescriptor.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_9serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_9serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_8serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_9serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_8serialize(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_8serialize(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":592
 * 
 *         """
 *         return GetResultValue(self.descriptor.SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->descriptor.SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 592, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":585
 *         return (<FlightDescriptor> descriptor).descriptor
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":594
 *         return GetResultValue(self.descriptor.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_11deserialize(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_7pyarrow_7_flight_16FlightDescriptor_10deserialize, "FlightDescriptor.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_11deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_11deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_10deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_11deserialize(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_serialized = 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("deserialize (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_serialized,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, 594, __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, 594, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 594, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 594, __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, 594, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 594, __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("pyarrow._flight.FlightDescriptor.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_10deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_16FlightDescriptor_10deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::FlightDescriptor __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":603
 *         """
 *         cdef FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *         descriptor.descriptor = GetResultValue(
 *             CFlightDescriptor.Deserialize(tobytes(serialized)))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":605
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         descriptor.descriptor = GetResultValue(
 *             CFlightDescriptor.Deserialize(tobytes(serialized)))             # <<<<<<<<<<<<<<
 *         return descriptor
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":604
 *         cdef FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         descriptor.descriptor = GetResultValue(             # <<<<<<<<<<<<<<
 *             CFlightDescriptor.Deserialize(tobytes(serialized)))
 *         return descriptor
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::FlightDescriptor>( arrow::flight::FlightDescriptor::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error)
  __pyx_v_descriptor->descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":606
 *         descriptor.descriptor = GetResultValue(
 *             CFlightDescriptor.Deserialize(tobytes(serialized)))
 *         return descriptor             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, FlightDescriptor other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_descriptor);
  __pyx_r = ((PyObject *)__pyx_v_descriptor);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":594
 *         return GetResultValue(self.descriptor.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descriptor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":608
 *         return descriptor
 * 
 *     def __eq__(self, FlightDescriptor other):             # <<<<<<<<<<<<<<
 *         return self.descriptor == other.descriptor
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 1, "other", 0))) __PYX_ERR(0, 608, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_12__eq__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_16FlightDescriptor_12__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":609
 * 
 *     def __eq__(self, FlightDescriptor other):
 *         return self.descriptor == other.descriptor             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->descriptor == __pyx_v_other->descriptor)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":608
 *         return descriptor
 * 
 *     def __eq__(self, FlightDescriptor other):             # <<<<<<<<<<<<<<
 *         return self.descriptor == other.descriptor
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.__eq__", __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.descriptor cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__, "FlightDescriptor.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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.descriptor cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_descriptor_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightDescriptor.__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.descriptor cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__, "FlightDescriptor.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightDescriptor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__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_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__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.descriptor cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_descriptor_cannot_be_conver, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":618
 *         CTicket c_ticket
 * 
 *     def __init__(self, ticket):             # <<<<<<<<<<<<<<
 *         self.c_ticket.ticket = tobytes(ticket)
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_6Ticket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_6Ticket_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ticket = 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_ticket,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, 618, __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, 618, __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, 618, __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, 618, __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, 618, __pyx_L3_error)
    }
    __pyx_v_ticket = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 618, __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("pyarrow._flight.Ticket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Ticket___init__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self), __pyx_v_ticket);

  /* 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_7pyarrow_7_flight_6Ticket___init__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self, PyObject *__pyx_v_ticket) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":619
 * 
 *     def __init__(self, ticket):
 *         self.c_ticket.ticket = tobytes(ticket)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __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_v_ticket};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->c_ticket.ticket = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":618
 *         CTicket c_ticket
 * 
 *     def __init__(self, ticket):             # <<<<<<<<<<<<<<
 *         self.c_ticket.ticket = tobytes(ticket)
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Ticket.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":621
 *         self.c_ticket.ticket = tobytes(ticket)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ticket(self):
 *         return self.c_ticket.ticket
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_6ticket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_6ticket_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_7pyarrow_7_flight_6Ticket_6ticket___get__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_6ticket___get__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__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);

  /* "pyarrow/_flight.pyx":623
 *     @property
 *     def ticket(self):
 *         return self.c_ticket.ticket             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->c_ticket.ticket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":621
 *         self.c_ticket.ticket = tobytes(ticket)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ticket(self):
 *         return self.c_ticket.ticket
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.Ticket.ticket.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":625
 *         return self.c_ticket.ticket
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Ticket_2serialize, "Ticket.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Ticket_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Ticket_2serialize(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_2serialize(struct __pyx_obj_7pyarrow_7_flight_Ticket *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":632
 * 
 *         """
 *         return GetResultValue(self.c_ticket.SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->c_ticket.SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":625
 *         return self.c_ticket.ticket
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.Ticket.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":634
 *         return GetResultValue(self.c_ticket.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_5deserialize(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_7pyarrow_7_flight_6Ticket_4deserialize, "Ticket.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Ticket_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 634, __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, 634, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 634, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 634, __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, 634, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 634, __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("pyarrow._flight.Ticket.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Ticket_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_6Ticket_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_ticket = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::Ticket __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":642
 * 
 *         """
 *         cdef Ticket ticket = Ticket.__new__(Ticket)             # <<<<<<<<<<<<<<
 *         ticket.c_ticket = GetResultValue(
 *             CTicket.Deserialize(tobytes(serialized)))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Ticket(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_ticket = ((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":644
 *         cdef Ticket ticket = Ticket.__new__(Ticket)
 *         ticket.c_ticket = GetResultValue(
 *             CTicket.Deserialize(tobytes(serialized)))             # <<<<<<<<<<<<<<
 *         return ticket
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":643
 *         """
 *         cdef Ticket ticket = Ticket.__new__(Ticket)
 *         ticket.c_ticket = GetResultValue(             # <<<<<<<<<<<<<<
 *             CTicket.Deserialize(tobytes(serialized)))
 *         return ticket
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::Ticket>( arrow::flight::Ticket::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
  __pyx_v_ticket->c_ticket = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":645
 *         ticket.c_ticket = GetResultValue(
 *             CTicket.Deserialize(tobytes(serialized)))
 *         return ticket             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, Ticket other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ticket);
  __pyx_r = ((PyObject *)__pyx_v_ticket);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":634
 *         return GetResultValue(self.c_ticket.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Ticket.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ticket);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":647
 *         return ticket
 * 
 *     def __eq__(self, Ticket other):             # <<<<<<<<<<<<<<
 *         return self.c_ticket == other.c_ticket
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, 1, "other", 0))) __PYX_ERR(0, 647, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Ticket_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_6Ticket_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":648
 * 
 *     def __eq__(self, Ticket other):
 *         return self.c_ticket == other.c_ticket             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->c_ticket == __pyx_v_other->c_ticket)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":647
 *         return ticket
 * 
 *     def __eq__(self, Ticket other):             # <<<<<<<<<<<<<<
 *         return self.c_ticket == other.c_ticket
 * 
*/

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

/* "pyarrow/_flight.pyx":650
 *         return self.c_ticket == other.c_ticket
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.Ticket ticket={self.ticket!r}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_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_7pyarrow_7_flight_6Ticket_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_8__repr__(struct __pyx_obj_7pyarrow_7_flight_Ticket *__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);

  /* "pyarrow/_flight.pyx":651
 * 
 *     def __repr__(self):
 *         return f"<pyarrow.flight.Ticket ticket={self.ticket!r}>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ticket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __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_pyarrow_flight_Ticket_ticket;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 30 + __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, 651, __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;

  /* "pyarrow/_flight.pyx":650
 *         return self.c_ticket == other.c_ticket
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.Ticket ticket={self.ticket!r}>"
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Ticket_10__reduce_cython__, "Ticket.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Ticket_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_6Ticket_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_6Ticket_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Ticket *__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.c_ticket cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_ticket cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_ticket_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_6Ticket_12__setstate_cython__, "Ticket.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_6Ticket_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_6Ticket_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.Ticket.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6Ticket_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__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_7pyarrow_7_flight_6Ticket_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Ticket *__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.c_ticket cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_ticket cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_ticket_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":659
 *         CLocation location
 * 
 *     def __init__(self, uri):             # <<<<<<<<<<<<<<
 *         check_flight_status(CLocation.Parse(tobytes(uri)).Value(&self.location))
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_8Location_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_8Location_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_uri = 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_uri,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, 659, __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, 659, __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, 659, __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, 659, __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, 659, __pyx_L3_error)
    }
    __pyx_v_uri = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 659, __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("pyarrow._flight.Location.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location___init__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self), __pyx_v_uri);

  /* 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_7pyarrow_7_flight_8Location___init__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, PyObject *__pyx_v_uri) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":660
 * 
 *     def __init__(self, uri):
 *         check_flight_status(CLocation.Parse(tobytes(uri)).Value(&self.location))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __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_v_uri};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::Parse(__pyx_t_5).Value((&__pyx_v_self->location))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 660, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":659
 *         CLocation location
 * 
 *     def __init__(self, uri):             # <<<<<<<<<<<<<<
 *         check_flight_status(CLocation.Parse(tobytes(uri)).Value(&self.location))
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Location.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":662
 *         check_flight_status(CLocation.Parse(tobytes(uri)).Value(&self.location))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f'<pyarrow.flight.Location {self.location.ToString()}>'
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_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_7pyarrow_7_flight_8Location_2__repr__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_2__repr__(struct __pyx_obj_7pyarrow_7_flight_Location *__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);

  /* "pyarrow/_flight.pyx":663
 * 
 *     def __repr__(self):
 *         return f'<pyarrow.flight.Location {self.location.ToString()}>'             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->location.ToString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __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_pyarrow_flight_Location;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 25 + __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, 663, __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;

  /* "pyarrow/_flight.pyx":662
 *         check_flight_status(CLocation.Parse(tobytes(uri)).Value(&self.location))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f'<pyarrow.flight.Location {self.location.ToString()}>'
 * 
*/

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

/* "pyarrow/_flight.pyx":665
 *         return f'<pyarrow.flight.Location {self.location.ToString()}>'
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def uri(self):
 *         return self.location.ToString()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_3uri_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_3uri_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_7pyarrow_7_flight_8Location_3uri___get__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_3uri___get__(struct __pyx_obj_7pyarrow_7_flight_Location *__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);

  /* "pyarrow/_flight.pyx":667
 *     @property
 *     def uri(self):
 *         return self.location.ToString()             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Location other):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->location.ToString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":665
 *         return f'<pyarrow.flight.Location {self.location.ToString()}>'
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def uri(self):
 *         return self.location.ToString()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.Location.uri.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":669
 *         return self.location.ToString()
 * 
 *     def equals(self, Location other):             # <<<<<<<<<<<<<<
 *         return self == other
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_5equals(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_8Location_4equals, "Location.equals(self, Location other)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_5equals = {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_5equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_4equals};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_5equals(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_Location *__pyx_v_other = 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("equals (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_other,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  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, "equals", 0) < (0)) __PYX_ERR(0, 669, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, i); __PYX_ERR(0, 669, __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, 669, __pyx_L3_error)
    }
    __pyx_v_other = ((struct __pyx_obj_7pyarrow_7_flight_Location *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equals", 1, 1, 1, __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("pyarrow._flight.Location.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, 1, "other", 0))) __PYX_ERR(0, 669, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_4equals(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self), __pyx_v_other);

  /* 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_7pyarrow_7_flight_8Location_4equals(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_other) {
  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("equals", 0);

  /* "pyarrow/_flight.pyx":670
 * 
 *     def equals(self, Location other):
 *         return self == other             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":669
 *         return self.location.ToString()
 * 
 *     def equals(self, Location other):             # <<<<<<<<<<<<<<
 *         return self == other
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.Location.equals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":672
 *         return self == other
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Location):
 *             return NotImplemented
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self), ((PyObject *)__pyx_v_other));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_6__eq__(struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/_flight.pyx":673
 * 
 *     def __eq__(self, other):
 *         if not isinstance(other, Location):             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         return self.location.Equals((<Location> other).location)
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":674
 *     def __eq__(self, other):
 *         if not isinstance(other, Location):
 *             return NotImplemented             # <<<<<<<<<<<<<<
 *         return self.location.Equals((<Location> other).location)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":673
 * 
 *     def __eq__(self, other):
 *         if not isinstance(other, Location):             # <<<<<<<<<<<<<<
 *             return NotImplemented
 *         return self.location.Equals((<Location> other).location)
*/
  }

  /* "pyarrow/_flight.pyx":675
 *         if not isinstance(other, Location):
 *             return NotImplemented
 *         return self.location.Equals((<Location> other).location)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->location.Equals(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_other)->location)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":672
 *         return self == other
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if not isinstance(other, Location):
 *             return NotImplemented
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Location.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":677
 *         return self.location.Equals((<Location> other).location)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tcp(host, port):
 *         """Create a Location for a TCP-based gRPC service."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_9for_grpc_tcp(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_7pyarrow_7_flight_8Location_8for_grpc_tcp, "Location.for_grpc_tcp(host, port)\n\nCreate a Location for a TCP-based gRPC service.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_9for_grpc_tcp = {"for_grpc_tcp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_9for_grpc_tcp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_8for_grpc_tcp};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_9for_grpc_tcp(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_host = 0;
  PyObject *__pyx_v_port = 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("for_grpc_tcp (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_host,&__pyx_mstate_global->__pyx_n_u_port,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, 677, __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, 677, __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, 677, __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, "for_grpc_tcp", 0) < (0)) __PYX_ERR(0, 677, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("for_grpc_tcp", 1, 2, 2, i); __PYX_ERR(0, 677, __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, 677, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 677, __pyx_L3_error)
    }
    __pyx_v_host = values[0];
    __pyx_v_port = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("for_grpc_tcp", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 677, __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("pyarrow._flight.Location.for_grpc_tcp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_8for_grpc_tcp(__pyx_v_host, __pyx_v_port);

  /* 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_7pyarrow_7_flight_8Location_8for_grpc_tcp(PyObject *__pyx_v_host, PyObject *__pyx_v_port) {
  std::string __pyx_v_c_host;
  int __pyx_v_c_port;
  struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("for_grpc_tcp", 0);

  /* "pyarrow/_flight.pyx":681
 *         """Create a Location for a TCP-based gRPC service."""
 *         cdef:
 *             c_string c_host = tobytes(host)             # <<<<<<<<<<<<<<
 *             int c_port = port
 *             Location result = Location.__new__(Location)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __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_v_host};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_host = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":682
 *         cdef:
 *             c_string c_host = tobytes(host)
 *             int c_port = port             # <<<<<<<<<<<<<<
 *             Location result = Location.__new__(Location)
 *         check_flight_status(
*/
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_port); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 682, __pyx_L1_error)
  __pyx_v_c_port = __pyx_t_6;

  /* "pyarrow/_flight.pyx":683
 *             c_string c_host = tobytes(host)
 *             int c_port = port
 *             Location result = Location.__new__(Location)             # <<<<<<<<<<<<<<
 *         check_flight_status(
 *             CLocation.ForGrpcTcp(c_host, c_port).Value(&result.location))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Location(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":684
 *             int c_port = port
 *             Location result = Location.__new__(Location)
 *         check_flight_status(             # <<<<<<<<<<<<<<
 *             CLocation.ForGrpcTcp(c_host, c_port).Value(&result.location))
 *         return result
*/
  __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::ForGrpcTcp(__pyx_v_c_host, __pyx_v_c_port).Value((&__pyx_v_result->location))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":686
 *         check_flight_status(
 *             CLocation.ForGrpcTcp(c_host, c_port).Value(&result.location))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":677
 *         return self.location.Equals((<Location> other).location)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tcp(host, port):
 *         """Create a Location for a TCP-based gRPC service."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Location.for_grpc_tcp", __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;
}

/* "pyarrow/_flight.pyx":688
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tls(host, port):
 *         """Create a Location for a TLS-based gRPC service."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_11for_grpc_tls(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_7pyarrow_7_flight_8Location_10for_grpc_tls, "Location.for_grpc_tls(host, port)\n\nCreate a Location for a TLS-based gRPC service.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_11for_grpc_tls = {"for_grpc_tls", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_11for_grpc_tls, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_10for_grpc_tls};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_11for_grpc_tls(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_host = 0;
  PyObject *__pyx_v_port = 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("for_grpc_tls (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_host,&__pyx_mstate_global->__pyx_n_u_port,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, 688, __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, 688, __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, 688, __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, "for_grpc_tls", 0) < (0)) __PYX_ERR(0, 688, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("for_grpc_tls", 1, 2, 2, i); __PYX_ERR(0, 688, __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, 688, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 688, __pyx_L3_error)
    }
    __pyx_v_host = values[0];
    __pyx_v_port = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("for_grpc_tls", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 688, __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("pyarrow._flight.Location.for_grpc_tls", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_10for_grpc_tls(__pyx_v_host, __pyx_v_port);

  /* 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_7pyarrow_7_flight_8Location_10for_grpc_tls(PyObject *__pyx_v_host, PyObject *__pyx_v_port) {
  std::string __pyx_v_c_host;
  int __pyx_v_c_port;
  struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("for_grpc_tls", 0);

  /* "pyarrow/_flight.pyx":692
 *         """Create a Location for a TLS-based gRPC service."""
 *         cdef:
 *             c_string c_host = tobytes(host)             # <<<<<<<<<<<<<<
 *             int c_port = port
 *             Location result = Location.__new__(Location)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __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_v_host};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_host = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":693
 *         cdef:
 *             c_string c_host = tobytes(host)
 *             int c_port = port             # <<<<<<<<<<<<<<
 *             Location result = Location.__new__(Location)
 *         check_flight_status(
*/
  __pyx_t_6 = __Pyx_PyLong_As_int(__pyx_v_port); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error)
  __pyx_v_c_port = __pyx_t_6;

  /* "pyarrow/_flight.pyx":694
 *             c_string c_host = tobytes(host)
 *             int c_port = port
 *             Location result = Location.__new__(Location)             # <<<<<<<<<<<<<<
 *         check_flight_status(
 *             CLocation.ForGrpcTls(c_host, c_port).Value(&result.location))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Location(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":695
 *             int c_port = port
 *             Location result = Location.__new__(Location)
 *         check_flight_status(             # <<<<<<<<<<<<<<
 *             CLocation.ForGrpcTls(c_host, c_port).Value(&result.location))
 *         return result
*/
  __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::ForGrpcTls(__pyx_v_c_host, __pyx_v_c_port).Value((&__pyx_v_result->location))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":697
 *         check_flight_status(
 *             CLocation.ForGrpcTls(c_host, c_port).Value(&result.location))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":688
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tls(host, port):
 *         """Create a Location for a TLS-based gRPC service."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Location.for_grpc_tls", __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;
}

/* "pyarrow/_flight.pyx":699
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_unix(path):
 *         """Create a Location for a domain socket-based gRPC service."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_13for_grpc_unix(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_7pyarrow_7_flight_8Location_12for_grpc_unix, "Location.for_grpc_unix(path)\n\nCreate a Location for a domain socket-based gRPC service.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_13for_grpc_unix = {"for_grpc_unix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_13for_grpc_unix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_12for_grpc_unix};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_13for_grpc_unix(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_path = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("for_grpc_unix (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_path,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, 699, __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, 699, __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, "for_grpc_unix", 0) < (0)) __PYX_ERR(0, 699, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("for_grpc_unix", 1, 1, 1, i); __PYX_ERR(0, 699, __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, 699, __pyx_L3_error)
    }
    __pyx_v_path = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("for_grpc_unix", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 699, __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("pyarrow._flight.Location.for_grpc_unix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_12for_grpc_unix(__pyx_v_path);

  /* 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_7pyarrow_7_flight_8Location_12for_grpc_unix(PyObject *__pyx_v_path) {
  std::string __pyx_v_c_path;
  struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("for_grpc_unix", 0);

  /* "pyarrow/_flight.pyx":703
 *         """Create a Location for a domain socket-based gRPC service."""
 *         cdef:
 *             c_string c_path = tobytes(path)             # <<<<<<<<<<<<<<
 *             Location result = Location.__new__(Location)
 *         check_flight_status(CLocation.ForGrpcUnix(c_path).Value(&result.location))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __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_v_path};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":704
 *         cdef:
 *             c_string c_path = tobytes(path)
 *             Location result = Location.__new__(Location)             # <<<<<<<<<<<<<<
 *         check_flight_status(CLocation.ForGrpcUnix(c_path).Value(&result.location))
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Location(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":705
 *             c_string c_path = tobytes(path)
 *             Location result = Location.__new__(Location)
 *         check_flight_status(CLocation.ForGrpcUnix(c_path).Value(&result.location))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::ForGrpcUnix(__pyx_v_c_path).Value((&__pyx_v_result->location))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 705, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":706
 *             Location result = Location.__new__(Location)
 *         check_flight_status(CLocation.ForGrpcUnix(c_path).Value(&result.location))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":699
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_unix(path):
 *         """Create a Location for a domain socket-based gRPC service."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.Location.for_grpc_unix", __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;
}

/* "pyarrow/_flight.pyx":708
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Location wrap(CLocation location):
 *         cdef Location result = Location.__new__(Location)
*/

static struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_f_7pyarrow_7_flight_8Location_wrap( arrow::flight::Location __pyx_v_location) {
  struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":710
 *     @staticmethod
 *     cdef Location wrap(CLocation location):
 *         cdef Location result = Location.__new__(Location)             # <<<<<<<<<<<<<<
 *         result.location = location
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Location(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":711
 *     cdef Location wrap(CLocation location):
 *         cdef Location result = Location.__new__(Location)
 *         result.location = location             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->location = __pyx_v_location;

  /* "pyarrow/_flight.pyx":712
 *         cdef Location result = Location.__new__(Location)
 *         result.location = location
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":708
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef Location wrap(CLocation location):
 *         cdef Location result = Location.__new__(Location)
*/

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

/* "pyarrow/_flight.pyx":714
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CLocation unwrap(object location) except *:
 *         cdef CLocation c_location
*/

static  arrow::flight::Location __pyx_f_7pyarrow_7_flight_8Location_unwrap(PyObject *__pyx_v_location) {
   arrow::flight::Location __pyx_v_c_location;
   arrow::flight::Location __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::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9[3];
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unwrap", 0);

  /* "pyarrow/_flight.pyx":717
 *     cdef CLocation unwrap(object location) except *:
 *         cdef CLocation c_location
 *         if isinstance(location, str):             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_location); 
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":719
 *         if isinstance(location, str):
 *             check_flight_status(
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))             # <<<<<<<<<<<<<<
 *             return c_location
 *         elif not isinstance(location, Location):
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __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_v_location};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 719, __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, 719, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":718
 *         cdef CLocation c_location
 *         if isinstance(location, str):
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
 *             return c_location
*/
    __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::Parse(__pyx_t_6).Value((&__pyx_v_c_location))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 718, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":720
 *             check_flight_status(
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
 *             return c_location             # <<<<<<<<<<<<<<
 *         elif not isinstance(location, Location):
 *             raise TypeError(f"Must provide a Location, not '{type(location)}'")
*/
    __pyx_r = __pyx_v_c_location;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":717
 *     cdef CLocation unwrap(object location) except *:
 *         cdef CLocation c_location
 *         if isinstance(location, str):             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
*/
  }

  /* "pyarrow/_flight.pyx":721
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
 *             return c_location
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError(f"Must provide a Location, not '{type(location)}'")
 *         return (<Location> location).location
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location); 
  __pyx_t_8 = (!__pyx_t_1);
  if (unlikely(__pyx_t_8)) {

    /* "pyarrow/_flight.pyx":722
 *             return c_location
 *         elif not isinstance(location, Location):
 *             raise TypeError(f"Must provide a Location, not '{type(location)}'")             # <<<<<<<<<<<<<<
 *         return (<Location> location).location
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_location)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Must_provide_a_Location_not;
    __pyx_t_9[1] = __pyx_t_3;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
    if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __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, 722, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":721
 *                 CLocation.Parse(tobytes(location)).Value(&c_location))
 *             return c_location
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError(f"Must provide a Location, not '{type(location)}'")
 *         return (<Location> location).location
*/
  }

  /* "pyarrow/_flight.pyx":723
 *         elif not isinstance(location, Location):
 *             raise TypeError(f"Must provide a Location, not '{type(location)}'")
 *         return (<Location> location).location             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_location)->location;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":714
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef CLocation unwrap(object location) except *:
 *         cdef CLocation c_location
*/

  /* 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_10);
  __Pyx_AddTraceback("pyarrow._flight.Location.unwrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_8Location_14__reduce_cython__, "Location.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_14__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_15__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_8Location_14__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_8Location_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Location *__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.location cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_location_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.Location.__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.location cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_8Location_16__setstate_cython__, "Location.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_8Location_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_16__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_8Location_17__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.Location.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8Location_16__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_Location *)__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_7pyarrow_7_flight_8Location_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_Location *__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.location cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_location_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":731
 *         CFlightEndpoint endpoint
 * 
 *     def __init__(self, ticket, locations, expiration_time=None, app_metadata=""):             # <<<<<<<<<<<<<<
 *         """Create a FlightEndpoint from a ticket and list of locations.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_14FlightEndpoint___init__, "Create a FlightEndpoint from a ticket and list of locations.\n\n        Parameters\n        ----------\n        ticket : Ticket or bytes\n            the ticket needed to access this flight\n        locations : list of string URIs\n            locations where this flight is available\n        expiration_time : TimestampScalar, default None\n            Expiration time of this stream. If present, clients may assume\n            they can retry DoGet requests. Otherwise, clients should avoid\n            retrying DoGet requests.\n        app_metadata : bytes or str, default \"\"\n            Application-defined opaque metadata.\n\n        Raises\n        ------\n        ArrowException\n            If one of the location URIs is not a valid URI.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_14FlightEndpoint___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ticket = 0;
  PyObject *__pyx_v_locations = 0;
  PyObject *__pyx_v_expiration_time = 0;
  PyObject *__pyx_v_app_metadata = 0;
  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_ticket,&__pyx_mstate_global->__pyx_n_u_locations,&__pyx_mstate_global->__pyx_n_u_expiration_time,&__pyx_mstate_global->__pyx_n_u_app_metadata,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, 731, __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, 731, __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, 731, __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, 731, __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, 731, __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, 731, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__5));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 731, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 731, __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, 731, __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, 731, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 731, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__5));
    }
    __pyx_v_ticket = values[0];
    __pyx_v_locations = values[1];
    __pyx_v_expiration_time = values[2];
    __pyx_v_app_metadata = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 731, __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("pyarrow._flight.FlightEndpoint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14FlightEndpoint___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self), __pyx_v_ticket, __pyx_v_locations, __pyx_v_expiration_time, __pyx_v_app_metadata);

  /* 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_7pyarrow_7_flight_14FlightEndpoint___init__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self, PyObject *__pyx_v_ticket, PyObject *__pyx_v_locations, PyObject *__pyx_v_expiration_time, PyObject *__pyx_v_app_metadata) {
   arrow::flight::Location __pyx_v_c_location;
  PyObject *__pyx_v_location = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9[3];
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
   arrow::flight::Location __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int64_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":755
 *             CLocation c_location
 * 
 *         if isinstance(ticket, Ticket):             # <<<<<<<<<<<<<<
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)
 *         elif isinstance(ticket, (str, bytes)):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ticket, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket); 
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":756
 * 
 *         if isinstance(ticket, Ticket):
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)             # <<<<<<<<<<<<<<
 *         elif isinstance(ticket, (str, bytes)):
 *             self.endpoint.ticket.ticket = tobytes(ticket)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ticket, __pyx_mstate_global->__pyx_n_u_ticket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __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((PyObject*)__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, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->endpoint.ticket.ticket = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":755
 *             CLocation c_location
 * 
 *         if isinstance(ticket, Ticket):             # <<<<<<<<<<<<<<
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)
 *         elif isinstance(ticket, (str, bytes)):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":757
 *         if isinstance(ticket, Ticket):
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)
 *         elif isinstance(ticket, (str, bytes)):             # <<<<<<<<<<<<<<
 *             self.endpoint.ticket.ticket = tobytes(ticket)
 *         else:
*/
  __pyx_t_8 = PyUnicode_Check(__pyx_v_ticket); 
  if (!__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = PyBytes_Check(__pyx_v_ticket); 
  __pyx_t_1 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (likely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":758
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)
 *         elif isinstance(ticket, (str, bytes)):
 *             self.endpoint.ticket.ticket = tobytes(ticket)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Argument ticket must be a Ticket instance, string or bytes, "
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __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_v_ticket};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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_2)) __PYX_ERR(0, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->endpoint.ticket.ticket = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":757
 *         if isinstance(ticket, Ticket):
 *             self.endpoint.ticket.ticket = tobytes(ticket.ticket)
 *         elif isinstance(ticket, (str, bytes)):             # <<<<<<<<<<<<<<
 *             self.endpoint.ticket.ticket = tobytes(ticket)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":760
 *             self.endpoint.ticket.ticket = tobytes(ticket)
 *         else:
 *             raise TypeError("Argument ticket must be a Ticket instance, string or bytes, "             # <<<<<<<<<<<<<<
 *                             f"not '{type(ticket)}'")
 * 
*/
  /*else*/ {
    __pyx_t_5 = NULL;

    /* "pyarrow/_flight.pyx":761
 *         else:
 *             raise TypeError("Argument ticket must be a Ticket instance, string or bytes, "
 *                             f"not '{type(ticket)}'")             # <<<<<<<<<<<<<<
 * 
 *         for location in locations:
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_ticket)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Argument_ticket_must_be_a_Ticket;
    __pyx_t_9[1] = __pyx_t_4;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;

    /* "pyarrow/_flight.pyx":760
 *             self.endpoint.ticket.ticket = tobytes(ticket)
 *         else:
 *             raise TypeError("Argument ticket must be a Ticket instance, string or bytes, "             # <<<<<<<<<<<<<<
 *                             f"not '{type(ticket)}'")
 * 
*/
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 65 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __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, 760, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":763
 *                             f"not '{type(ticket)}'")
 * 
 *         for location in locations:             # <<<<<<<<<<<<<<
 *             if isinstance(location, Location):
 *                 c_location = (<Location> location).location
*/
  if (likely(PyList_CheckExact(__pyx_v_locations)) || PyTuple_CheckExact(__pyx_v_locations)) {
    __pyx_t_2 = __pyx_v_locations; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_locations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 763, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_11)) {
      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, 763, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_10;
      } 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, 763, __pyx_L1_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10);
        #endif
        ++__pyx_t_10;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_11(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 763, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_location, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":764
 * 
 *         for location in locations:
 *             if isinstance(location, Location):             # <<<<<<<<<<<<<<
 *                 c_location = (<Location> location).location
 *             elif isinstance(location, (str, bytes)):
*/
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location); 
    if (__pyx_t_1) {

      /* "pyarrow/_flight.pyx":765
 *         for location in locations:
 *             if isinstance(location, Location):
 *                 c_location = (<Location> location).location             # <<<<<<<<<<<<<<
 *             elif isinstance(location, (str, bytes)):
 *                 c_location = CLocation()
*/
      __pyx_t_12 = ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_location)->location;
      __pyx_v_c_location = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_12);

      /* "pyarrow/_flight.pyx":764
 * 
 *         for location in locations:
 *             if isinstance(location, Location):             # <<<<<<<<<<<<<<
 *                 c_location = (<Location> location).location
 *             elif isinstance(location, (str, bytes)):
*/
      goto __pyx_L8;
    }

    /* "pyarrow/_flight.pyx":766
 *             if isinstance(location, Location):
 *                 c_location = (<Location> location).location
 *             elif isinstance(location, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 c_location = CLocation()
 *                 check_flight_status(
*/
    __pyx_t_8 = PyUnicode_Check(__pyx_v_location); 
    if (!__pyx_t_8) {
    } else {
      __pyx_t_1 = __pyx_t_8;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_8 = PyBytes_Check(__pyx_v_location); 
    __pyx_t_1 = __pyx_t_8;
    __pyx_L9_bool_binop_done:;
    if (likely(__pyx_t_1)) {

      /* "pyarrow/_flight.pyx":767
 *                 c_location = (<Location> location).location
 *             elif isinstance(location, (str, bytes)):
 *                 c_location = CLocation()             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     CLocation.Parse(tobytes(location)).Value(&c_location))
*/
      __pyx_v_c_location =  arrow::flight::Location();

      /* "pyarrow/_flight.pyx":769
 *                 c_location = CLocation()
 *                 check_flight_status(
 *                     CLocation.Parse(tobytes(location)).Value(&c_location))             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError("Argument locations must contain Location instances, strings or bytes, "
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __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_v_location};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 769, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 769, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "pyarrow/_flight.pyx":768
 *             elif isinstance(location, (str, bytes)):
 *                 c_location = CLocation()
 *                 check_flight_status(             # <<<<<<<<<<<<<<
 *                     CLocation.Parse(tobytes(location)).Value(&c_location))
 *             else:
*/
      __pyx_t_13 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::Location::Parse(__pyx_t_7).Value((&__pyx_v_c_location))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 768, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":766
 *             if isinstance(location, Location):
 *                 c_location = (<Location> location).location
 *             elif isinstance(location, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 c_location = CLocation()
 *                 check_flight_status(
*/
      goto __pyx_L8;
    }

    /* "pyarrow/_flight.pyx":771
 *                     CLocation.Parse(tobytes(location)).Value(&c_location))
 *             else:
 *                 raise TypeError("Argument locations must contain Location instances, strings or bytes, "             # <<<<<<<<<<<<<<
 *                                 f"not '{type(location)}'")
 *             self.endpoint.locations.push_back(c_location)
*/
    /*else*/ {
      __pyx_t_4 = NULL;

      /* "pyarrow/_flight.pyx":772
 *             else:
 *                 raise TypeError("Argument locations must contain Location instances, strings or bytes, "
 *                                 f"not '{type(location)}'")             # <<<<<<<<<<<<<<
 *             self.endpoint.locations.push_back(c_location)
 * 
*/
      __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_location)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 772, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Argument_locations_must_contain;
      __pyx_t_9[1] = __pyx_t_5;
      __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;

      /* "pyarrow/_flight.pyx":771
 *                     CLocation.Parse(tobytes(location)).Value(&c_location))
 *             else:
 *                 raise TypeError("Argument locations must contain Location instances, strings or bytes, "             # <<<<<<<<<<<<<<
 *                                 f"not '{type(location)}'")
 *             self.endpoint.locations.push_back(c_location)
*/
      __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 75 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_14};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __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, 771, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "pyarrow/_flight.pyx":773
 *                 raise TypeError("Argument locations must contain Location instances, strings or bytes, "
 *                                 f"not '{type(location)}'")
 *             self.endpoint.locations.push_back(c_location)             # <<<<<<<<<<<<<<
 * 
 *         if expiration_time is not None:
*/
    try {
      __pyx_v_self->endpoint.locations.push_back(__pyx_v_c_location);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 773, __pyx_L1_error)
    }

    /* "pyarrow/_flight.pyx":763
 *                             f"not '{type(ticket)}'")
 * 
 *         for location in locations:             # <<<<<<<<<<<<<<
 *             if isinstance(location, Location):
 *                 c_location = (<Location> location).location
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":775
 *             self.endpoint.locations.push_back(c_location)
 * 
 *         if expiration_time is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(expiration_time, lib.TimestampScalar):
 *                 self.endpoint.expiration_time = TimePoint_from_ns(
*/
  __pyx_t_1 = (__pyx_v_expiration_time != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":776
 * 
 *         if expiration_time is not None:
 *             if isinstance(expiration_time, lib.TimestampScalar):             # <<<<<<<<<<<<<<
 *                 self.endpoint.expiration_time = TimePoint_from_ns(
 *                     expiration_time.cast(timestamp("ns")).value)
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TimestampScalar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_expiration_time, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 776, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(__pyx_t_1)) {

      /* "pyarrow/_flight.pyx":778
 *             if isinstance(expiration_time, lib.TimestampScalar):
 *                 self.endpoint.expiration_time = TimePoint_from_ns(
 *                     expiration_time.cast(timestamp("ns")).value)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError("Argument expiration_time must be a TimestampScalar, "
*/
      __pyx_t_2 = __pyx_v_expiration_time;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __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_n_u_ns};
        __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__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_14)) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
      }
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_cast, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_15 = __Pyx_PyLong_As_int64_t(__pyx_t_14); if (unlikely((__pyx_t_15 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

      /* "pyarrow/_flight.pyx":777
 *         if expiration_time is not None:
 *             if isinstance(expiration_time, lib.TimestampScalar):
 *                 self.endpoint.expiration_time = TimePoint_from_ns(             # <<<<<<<<<<<<<<
 *                     expiration_time.cast(timestamp("ns")).value)
 *             else:
*/
      __pyx_v_self->endpoint.expiration_time = ((std::optional<arrow::py::internal::TimePoint> )arrow::py::internal::TimePoint_from_ns(__pyx_t_15));

      /* "pyarrow/_flight.pyx":776
 * 
 *         if expiration_time is not None:
 *             if isinstance(expiration_time, lib.TimestampScalar):             # <<<<<<<<<<<<<<
 *                 self.endpoint.expiration_time = TimePoint_from_ns(
 *                     expiration_time.cast(timestamp("ns")).value)
*/
      goto __pyx_L13;
    }

    /* "pyarrow/_flight.pyx":780
 *                     expiration_time.cast(timestamp("ns")).value)
 *             else:
 *                 raise TypeError("Argument expiration_time must be a TimestampScalar, "             # <<<<<<<<<<<<<<
 *                                 f"not '{type(expiration_time)}'")
 * 
*/
    /*else*/ {
      __pyx_t_3 = NULL;

      /* "pyarrow/_flight.pyx":781
 *             else:
 *                 raise TypeError("Argument expiration_time must be a TimestampScalar, "
 *                                 f"not '{type(expiration_time)}'")             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(app_metadata, (str, bytes)):
*/
      __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_expiration_time)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Argument_expiration_time_must_be;
      __pyx_t_9[1] = __pyx_t_2;
      __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;

      /* "pyarrow/_flight.pyx":780
 *                     expiration_time.cast(timestamp("ns")).value)
 *             else:
 *                 raise TypeError("Argument expiration_time must be a TimestampScalar, "             # <<<<<<<<<<<<<<
 *                                 f"not '{type(expiration_time)}'")
 * 
*/
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 57 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
        __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_14)) __PYX_ERR(0, 780, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
      }
      __Pyx_Raise(__pyx_t_14, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __PYX_ERR(0, 780, __pyx_L1_error)
    }
    __pyx_L13:;

    /* "pyarrow/_flight.pyx":775
 *             self.endpoint.locations.push_back(c_location)
 * 
 *         if expiration_time is not None:             # <<<<<<<<<<<<<<
 *             if isinstance(expiration_time, lib.TimestampScalar):
 *                 self.endpoint.expiration_time = TimePoint_from_ns(
*/
  }

  /* "pyarrow/_flight.pyx":783
 *                                 f"not '{type(expiration_time)}'")
 * 
 *         if not isinstance(app_metadata, (str, bytes)):             # <<<<<<<<<<<<<<
 *             raise TypeError("Argument app_metadata must be a string or bytes, "
 *                             f"not '{type(app_metadata)}'")
*/
  __pyx_t_8 = PyUnicode_Check(__pyx_v_app_metadata); 
  if (!__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_8 = PyBytes_Check(__pyx_v_app_metadata); 
  __pyx_t_1 = __pyx_t_8;
  __pyx_L15_bool_binop_done:;
  __pyx_t_8 = (!__pyx_t_1);
  if (unlikely(__pyx_t_8)) {

    /* "pyarrow/_flight.pyx":784
 * 
 *         if not isinstance(app_metadata, (str, bytes)):
 *             raise TypeError("Argument app_metadata must be a string or bytes, "             # <<<<<<<<<<<<<<
 *                             f"not '{type(app_metadata)}'")
 *         self.endpoint.app_metadata = tobytes(app_metadata)
*/
    __pyx_t_5 = NULL;

    /* "pyarrow/_flight.pyx":785
 *         if not isinstance(app_metadata, (str, bytes)):
 *             raise TypeError("Argument app_metadata must be a string or bytes, "
 *                             f"not '{type(app_metadata)}'")             # <<<<<<<<<<<<<<
 *         self.endpoint.app_metadata = tobytes(app_metadata)
 * 
*/
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_app_metadata)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Argument_app_metadata_must_be_a;
    __pyx_t_9[1] = __pyx_t_3;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u__3;

    /* "pyarrow/_flight.pyx":784
 * 
 *         if not isinstance(app_metadata, (str, bytes)):
 *             raise TypeError("Argument app_metadata must be a string or bytes, "             # <<<<<<<<<<<<<<
 *                             f"not '{type(app_metadata)}'")
 *         self.endpoint.app_metadata = tobytes(app_metadata)
*/
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 54 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
      __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
    }
    __Pyx_Raise(__pyx_t_14, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __PYX_ERR(0, 784, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":783
 *                                 f"not '{type(expiration_time)}'")
 * 
 *         if not isinstance(app_metadata, (str, bytes)):             # <<<<<<<<<<<<<<
 *             raise TypeError("Argument app_metadata must be a string or bytes, "
 *                             f"not '{type(app_metadata)}'")
*/
  }

  /* "pyarrow/_flight.pyx":786
 *             raise TypeError("Argument app_metadata must be a string or bytes, "
 *                             f"not '{type(app_metadata)}'")
 *         self.endpoint.app_metadata = tobytes(app_metadata)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __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_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_app_metadata};
    __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __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;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
  }
  __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_14); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_v_self->endpoint.app_metadata = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pyarrow/_flight.pyx":731
 *         CFlightEndpoint endpoint
 * 
 *     def __init__(self, ticket, locations, expiration_time=None, app_metadata=""):             # <<<<<<<<<<<<<<
 *         """Create a FlightEndpoint from a ticket and list of locations.
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_location);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":788
 *         self.endpoint.app_metadata = tobytes(app_metadata)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ticket(self):
 *         """Get the ticket in this endpoint."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_6ticket_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_6ticket_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_7pyarrow_7_flight_14FlightEndpoint_6ticket___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_6ticket___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__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("__get__", 0);

  /* "pyarrow/_flight.pyx":791
 *     def ticket(self):
 *         """Get the ticket in this endpoint."""
 *         return Ticket(self.endpoint.ticket.ticket)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->endpoint.ticket.ticket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __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, 791, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":788
 *         self.endpoint.app_metadata = tobytes(app_metadata)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ticket(self):
 *         """Get the ticket in this endpoint."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.ticket.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":793
 *         return Ticket(self.endpoint.ticket.ticket)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def locations(self):
 *         """Get locations where this flight is available."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9locations_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9locations_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_7pyarrow_7_flight_14FlightEndpoint_9locations___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_9locations___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self) {
   arrow::flight::Location __pyx_8genexpr1__pyx_v_location;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector< arrow::flight::Location> ::iterator __pyx_t_2;
   arrow::flight::Location __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":796
 *     def locations(self):
 *         """Get locations where this flight is available."""
 *         return [Location.wrap(location)             # <<<<<<<<<<<<<<
 *                 for location in self.endpoint.locations]
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/_flight.pyx":797
 *         """Get locations where this flight is available."""
 *         return [Location.wrap(location)
 *                 for location in self.endpoint.locations]             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    __pyx_t_2 = __pyx_v_self->endpoint.locations.begin();
    for (; __pyx_t_2 != __pyx_v_self->endpoint.locations.end(); ++__pyx_t_2) {
      __pyx_t_3 = *__pyx_t_2;
      __pyx_8genexpr1__pyx_v_location = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

      /* "pyarrow/_flight.pyx":796
 *     def locations(self):
 *         """Get locations where this flight is available."""
 *         return [Location.wrap(location)             # <<<<<<<<<<<<<<
 *                 for location in self.endpoint.locations]
 * 
*/
      __pyx_t_4 = ((PyObject *)__pyx_f_7pyarrow_7_flight_8Location_wrap(__pyx_8genexpr1__pyx_v_location)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":797
 *         """Get locations where this flight is available."""
 *         return [Location.wrap(location)
 *                 for location in self.endpoint.locations]             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":793
 *         return Ticket(self.endpoint.ticket.ticket)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def locations(self):
 *         """Get locations where this flight is available."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.locations.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":799
 *                 for location in self.endpoint.locations]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def expiration_time(self):
 *         """Get the expiration time of this stream.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_15expiration_time_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_15expiration_time_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_7pyarrow_7_flight_14FlightEndpoint_15expiration_time___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_15expiration_time___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self) {
  int64_t __pyx_v_time_since_epoch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_FakeReference<arrow::py::internal::TimePoint> __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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":809
 *         cdef:
 *             int64_t time_since_epoch
 *         if self.endpoint.expiration_time.has_value():             # <<<<<<<<<<<<<<
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))
*/
  __pyx_t_1 = (__pyx_v_self->endpoint.expiration_time.has_value() != 0);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":810
 *             int64_t time_since_epoch
 *         if self.endpoint.expiration_time.has_value():
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())             # <<<<<<<<<<<<<<
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))
 *         return None
*/
    try {
      __pyx_t_2 = __pyx_v_self->endpoint.expiration_time.value();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 810, __pyx_L1_error)
    }
    __pyx_v_time_since_epoch = arrow::py::internal::TimePoint_to_ns(__pyx_t_2);

    /* "pyarrow/_flight.pyx":811
 *         if self.endpoint.expiration_time.has_value():
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_scalar); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_time_since_epoch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __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_4 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__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_3)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":809
 *         cdef:
 *             int64_t time_since_epoch
 *         if self.endpoint.expiration_time.has_value():             # <<<<<<<<<<<<<<
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))
*/
  }

  /* "pyarrow/_flight.pyx":812
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":799
 *                 for location in self.endpoint.locations]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def expiration_time(self):
 *         """Get the expiration time of this stream.
*/

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

/* "pyarrow/_flight.pyx":814
 *         return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         """Get application-defined opaque metadata."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_12app_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_12app_metadata_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_7pyarrow_7_flight_14FlightEndpoint_12app_metadata___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__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);

  /* "pyarrow/_flight.pyx":817
 *     def app_metadata(self):
 *         """Get application-defined opaque metadata."""
 *         return self.endpoint.app_metadata             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->endpoint.app_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":814
 *         return None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         """Get application-defined opaque metadata."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.app_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":819
 *         return self.endpoint.app_metadata
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_14FlightEndpoint_2serialize, "FlightEndpoint.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14FlightEndpoint_2serialize(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_2serialize(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":826
 * 
 *         """
 *         return GetResultValue(self.endpoint.SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->endpoint.SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 826, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":819
 *         return self.endpoint.app_metadata
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":828
 *         return GetResultValue(self.endpoint.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_5deserialize(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_7pyarrow_7_flight_14FlightEndpoint_4deserialize, "FlightEndpoint.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 828, __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, 828, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 828, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 828, __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, 828, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 828, __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("pyarrow._flight.FlightEndpoint.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14FlightEndpoint_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_14FlightEndpoint_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_endpoint = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::FlightEndpoint __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":836
 * 
 *         """
 *         cdef FlightEndpoint endpoint = FlightEndpoint.__new__(FlightEndpoint)             # <<<<<<<<<<<<<<
 *         endpoint.endpoint = GetResultValue(
 *             CFlightEndpoint.Deserialize(tobytes(serialized)))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightEndpoint(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_endpoint = ((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":838
 *         cdef FlightEndpoint endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *         endpoint.endpoint = GetResultValue(
 *             CFlightEndpoint.Deserialize(tobytes(serialized)))             # <<<<<<<<<<<<<<
 *         return endpoint
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":837
 *         """
 *         cdef FlightEndpoint endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *         endpoint.endpoint = GetResultValue(             # <<<<<<<<<<<<<<
 *             CFlightEndpoint.Deserialize(tobytes(serialized)))
 *         return endpoint
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::FlightEndpoint>( arrow::flight::FlightEndpoint::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 837, __pyx_L1_error)
  __pyx_v_endpoint->endpoint = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":839
 *         endpoint.endpoint = GetResultValue(
 *             CFlightEndpoint.Deserialize(tobytes(serialized)))
 *         return endpoint             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_endpoint);
  __pyx_r = ((PyObject *)__pyx_v_endpoint);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":828
 *         return GetResultValue(self.endpoint.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_endpoint);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":841
 *         return endpoint
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "
 *                 f"locations={self.locations!r} "
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_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_7pyarrow_7_flight_14FlightEndpoint_6__repr__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_6__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6[9];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":842
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "             # <<<<<<<<<<<<<<
 *                 f"locations={self.locations!r} "
 *                 f"expiration_time={self.expiration_time} "
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ticket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":843
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "
 *                 f"locations={self.locations!r} "             # <<<<<<<<<<<<<<
 *                 f"expiration_time={self.expiration_time} "
 *                 f"app_metadata={self.app_metadata}>")
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_locations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":844
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "
 *                 f"locations={self.locations!r} "
 *                 f"expiration_time={self.expiration_time} "             # <<<<<<<<<<<<<<
 *                 f"app_metadata={self.app_metadata}>")
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_expiration_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":845
 *                 f"locations={self.locations!r} "
 *                 f"expiration_time={self.expiration_time} "
 *                 f"app_metadata={self.app_metadata}>")             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, FlightEndpoint other):
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_app_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightEndpoint_t;
  __pyx_t_6[1] = __pyx_t_2;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_locations_2;
  __pyx_t_6[3] = __pyx_t_3;
  __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_expiration_time_2;
  __pyx_t_6[5] = __pyx_t_4;
  __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u_app_metadata_2;
  __pyx_t_6[7] = __pyx_t_5;
  __pyx_t_6[8] = __pyx_mstate_global->__pyx_kp_u__6;

  /* "pyarrow/_flight.pyx":842
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "             # <<<<<<<<<<<<<<
 *                 f"locations={self.locations!r} "
 *                 f"expiration_time={self.expiration_time} "
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 9, 38 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 17 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":841
 *         return endpoint
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightEndpoint ticket={self.ticket!r} "
 *                 f"locations={self.locations!r} "
*/

  /* 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("pyarrow._flight.FlightEndpoint.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":847
 *                 f"app_metadata={self.app_metadata}>")
 * 
 *     def __eq__(self, FlightEndpoint other):             # <<<<<<<<<<<<<<
 *         return self.endpoint == other.endpoint
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, 1, "other", 0))) __PYX_ERR(0, 847, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14FlightEndpoint_8__eq__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_14FlightEndpoint_8__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":848
 * 
 *     def __eq__(self, FlightEndpoint other):
 *         return self.endpoint == other.endpoint             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->endpoint == __pyx_v_other->endpoint)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":847
 *                 f"app_metadata={self.app_metadata}>")
 * 
 *     def __eq__(self, FlightEndpoint other):             # <<<<<<<<<<<<<<
 *         return self.endpoint == other.endpoint
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.__eq__", __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.endpoint cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__, "FlightEndpoint.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__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.endpoint cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.endpoint cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_endpoint_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightEndpoint.__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.endpoint cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.endpoint cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__, "FlightEndpoint.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightEndpoint.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__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_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__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.endpoint cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.endpoint cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_endpoint_cannot_be_converte, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":856
 *         unique_ptr[CSchemaResult] result
 * 
 *     def __init__(self, Schema schema):             # <<<<<<<<<<<<<<
 *         """Create a SchemaResult from a schema.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_12SchemaResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12SchemaResult___init__, "Create a SchemaResult from a schema.\n\n        Parameters\n        ----------\n        schema: Schema\n            the schema of the data in this flight.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_12SchemaResult___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_12SchemaResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 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_schema,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, 856, __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, 856, __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, 856, __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, 856, __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, 856, __pyx_L3_error)
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 856, __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("pyarrow._flight.SchemaResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 856, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12SchemaResult___init__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self), __pyx_v_schema);

  /* 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_7pyarrow_7_flight_12SchemaResult___init__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  int __pyx_r;
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_flight.pyx":865
 *         """
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *         check_flight_status(CreateSchemaResult(c_schema, &self.result))
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error)
  __pyx_v_c_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":866
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)
 *         check_flight_status(CreateSchemaResult(c_schema, &self.result))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::py::flight::CreateSchemaResult(__pyx_v_c_schema, (&__pyx_v_self->result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 866, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":856
 *         unique_ptr[CSchemaResult] result
 * 
 *     def __init__(self, Schema schema):             # <<<<<<<<<<<<<<
 *         """Create a SchemaResult from a schema.
 * 
*/

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

/* "pyarrow/_flight.pyx":868
 *         check_flight_status(CreateSchemaResult(c_schema, &self.result))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The schema of the data in this flight."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_6schema_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_7pyarrow_7_flight_12SchemaResult_6schema___get__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_6schema___get__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self) {
  std::shared_ptr< arrow::Schema>  __pyx_v_schema;
   arrow::ipc::DictionaryMemo __pyx_v_dummy_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":875
 *             CDictionaryMemo dummy_memo
 * 
 *         check_flight_status(self.result.get().GetSchema(&dummy_memo).Value(&schema))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(schema)
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->result.get()->GetSchema((&__pyx_v_dummy_memo)).Value((&__pyx_v_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 875, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":876
 * 
 *         check_flight_status(self.result.get().GetSchema(&dummy_memo).Value(&schema))
 *         return pyarrow_wrap_schema(schema)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":868
 *         check_flight_status(CreateSchemaResult(c_schema, &self.result))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The schema of the data in this flight."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.SchemaResult.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":878
 *         return pyarrow_wrap_schema(schema)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12SchemaResult_2serialize, "SchemaResult.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12SchemaResult_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12SchemaResult_2serialize(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_2serialize(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":885
 * 
 *         """
 *         return GetResultValue(self.result.get().SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->result.get()->SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":878
 *         return pyarrow_wrap_schema(schema)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.SchemaResult.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":887
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_5deserialize(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_7pyarrow_7_flight_12SchemaResult_4deserialize, "SchemaResult.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12SchemaResult_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 887, __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, 887, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 887, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 887, __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, 887, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 887, __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("pyarrow._flight.SchemaResult.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12SchemaResult_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_12SchemaResult_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_result = 0;
  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;
  std::string __pyx_t_5;
   arrow::flight::SchemaResult __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":895
 * 
 *         """
 *         cdef SchemaResult result = SchemaResult.__new__(SchemaResult)             # <<<<<<<<<<<<<<
 *         result.result.reset(new CSchemaResult(GetResultValue(
 *             CSchemaResult.Deserialize(tobytes(serialized)))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_SchemaResult(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":897
 *         cdef SchemaResult result = SchemaResult.__new__(SchemaResult)
 *         result.result.reset(new CSchemaResult(GetResultValue(
 *             CSchemaResult.Deserialize(tobytes(serialized)))))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 897, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":896
 *         """
 *         cdef SchemaResult result = SchemaResult.__new__(SchemaResult)
 *         result.result.reset(new CSchemaResult(GetResultValue(             # <<<<<<<<<<<<<<
 *             CSchemaResult.Deserialize(tobytes(serialized)))))
 *         return result
*/
  __pyx_t_6 = arrow::py::GetResultValue< arrow::flight::SchemaResult>( arrow::flight::SchemaResult::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 896, __pyx_L1_error)
  __pyx_v_result->result.reset(new  arrow::flight::SchemaResult(__pyx_t_6));

  /* "pyarrow/_flight.pyx":898
 *         result.result.reset(new CSchemaResult(GetResultValue(
 *             CSchemaResult.Deserialize(tobytes(serialized)))))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, SchemaResult other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":887
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.SchemaResult.deserialize", __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;
}

/* "pyarrow/_flight.pyx":900
 *         return result
 * 
 *     def __eq__(self, SchemaResult other):             # <<<<<<<<<<<<<<
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult, 1, "other", 0))) __PYX_ERR(0, 900, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12SchemaResult_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_12SchemaResult_6__eq__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":901
 * 
 *     def __eq__(self, SchemaResult other):
 *         return deref(self.result.get()) == deref(other.result.get())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((*__pyx_v_self->result.get()) == (*__pyx_v_other->result.get()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":900
 *         return result
 * 
 *     def __eq__(self, SchemaResult other):             # <<<<<<<<<<<<<<
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
*/

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

/* "pyarrow/_flight.pyx":903
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.SchemaResult schema=({self.schema})>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_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_7pyarrow_7_flight_12SchemaResult_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_8__repr__(struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__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);

  /* "pyarrow/_flight.pyx":904
 * 
 *     def __repr__(self):
 *         return f"<pyarrow.flight.SchemaResult schema=({self.schema})>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 904, __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_pyarrow_flight_SchemaResult_sch;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__7;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 904, __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;

  /* "pyarrow/_flight.pyx":903
 *         return deref(self.result.get()) == deref(other.result.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<pyarrow.flight.SchemaResult schema=({self.schema})>"
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__, "SchemaResult.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__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.result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.SchemaResult.__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.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__, "SchemaResult.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.SchemaResult.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__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_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__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.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_result_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":912
 *         unique_ptr[CFlightInfo] info
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(CFlightInfo c_info):
 *         cdef FlightInfo obj = FlightInfo.__new__(FlightInfo)
*/

static PyObject *__pyx_f_7pyarrow_7_flight_10FlightInfo_wrap( arrow::flight::FlightInfo __pyx_v_c_info) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_obj = 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("wrap", 0);

  /* "pyarrow/_flight.pyx":914
 *     @staticmethod
 *     cdef wrap(CFlightInfo c_info):
 *         cdef FlightInfo obj = FlightInfo.__new__(FlightInfo)             # <<<<<<<<<<<<<<
 *         obj.info.reset(new CFlightInfo(move(c_info)))
 *         return obj
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightInfo(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_obj = ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":915
 *     cdef wrap(CFlightInfo c_info):
 *         cdef FlightInfo obj = FlightInfo.__new__(FlightInfo)
 *         obj.info.reset(new CFlightInfo(move(c_info)))             # <<<<<<<<<<<<<<
 *         return obj
 * 
*/
  __pyx_v_obj->info.reset(new  arrow::flight::FlightInfo(cython_std::move< arrow::flight::FlightInfo>(__pyx_v_c_info)));

  /* "pyarrow/_flight.pyx":916
 *         cdef FlightInfo obj = FlightInfo.__new__(FlightInfo)
 *         obj.info.reset(new CFlightInfo(move(c_info)))
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, Schema schema, FlightDescriptor descriptor, endpoints,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_obj);
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":912
 *         unique_ptr[CFlightInfo] info
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef wrap(CFlightInfo c_info):
 *         cdef FlightInfo obj = FlightInfo.__new__(FlightInfo)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":918
 *         return obj
 * 
 *     def __init__(self, Schema schema, FlightDescriptor descriptor, endpoints,             # <<<<<<<<<<<<<<
 *                  total_records=None, total_bytes=None, ordered=False, app_metadata=""):
 *         """Create a FlightInfo object from a schema, descriptor, and endpoints.
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_10FlightInfo_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_10FlightInfo___init__, "Create a FlightInfo object from a schema, descriptor, and endpoints.\n\n        Parameters\n        ----------\n        schema : Schema, optional\n            the schema of the data in this flight.\n        descriptor : FlightDescriptor\n            the descriptor for this flight.\n        endpoints : list of FlightEndpoint\n            a list of endpoints where this flight is available.\n        total_records : int, default None\n            the total records in this flight, -1 or None if unknown.\n        total_bytes : int, default None\n            the total bytes in this flight, -1 or None if unknown.\n        ordered : boolean, default False\n            Whether endpoints are in the same order as the data.\n        app_metadata : bytes or str, default \"\"\n            Application-defined opaque metadata.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_10FlightInfo___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_10FlightInfo_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_endpoints = 0;
  PyObject *__pyx_v_total_records = 0;
  PyObject *__pyx_v_total_bytes = 0;
  PyObject *__pyx_v_ordered = 0;
  PyObject *__pyx_v_app_metadata = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  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_schema,&__pyx_mstate_global->__pyx_n_u_descriptor,&__pyx_mstate_global->__pyx_n_u_endpoints,&__pyx_mstate_global->__pyx_n_u_total_records,&__pyx_mstate_global->__pyx_n_u_total_bytes,&__pyx_mstate_global->__pyx_n_u_ordered,&__pyx_mstate_global->__pyx_n_u_app_metadata,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, 918, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 918, __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, 918, __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, 918, __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, 918, __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, 918, __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, 918, __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, 918, __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, 918, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":919
 * 
 *     def __init__(self, Schema schema, FlightDescriptor descriptor, endpoints,
 *                  total_records=None, total_bytes=None, ordered=False, app_metadata=""):             # <<<<<<<<<<<<<<
 *         """Create a FlightInfo object from a schema, descriptor, and endpoints.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__5));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, i); __PYX_ERR(0, 918, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 918, __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, 918, __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, 918, __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, 918, __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, 918, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 918, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 918, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__5));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[1]);
    __pyx_v_endpoints = values[2];
    __pyx_v_total_records = values[3];
    __pyx_v_total_bytes = values[4];
    __pyx_v_ordered = values[5];
    __pyx_v_app_metadata = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 918, __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("pyarrow._flight.FlightInfo.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 1, "schema", 0))) __PYX_ERR(0, 918, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 1, "descriptor", 0))) __PYX_ERR(0, 918, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10FlightInfo___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self), __pyx_v_schema, __pyx_v_descriptor, __pyx_v_endpoints, __pyx_v_total_records, __pyx_v_total_bytes, __pyx_v_ordered, __pyx_v_app_metadata);

  /* "pyarrow/_flight.pyx":918
 *         return obj
 * 
 *     def __init__(self, Schema schema, FlightDescriptor descriptor, endpoints,             # <<<<<<<<<<<<<<
 *                  total_records=None, total_bytes=None, ordered=False, app_metadata=""):
 *         """Create a FlightInfo object from a schema, descriptor, and endpoints.
*/

  /* 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_7pyarrow_7_flight_10FlightInfo___init__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, PyObject *__pyx_v_endpoints, PyObject *__pyx_v_total_records, PyObject *__pyx_v_total_bytes, PyObject *__pyx_v_ordered, PyObject *__pyx_v_app_metadata) {
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  std::vector< arrow::flight::FlightEndpoint>  __pyx_v_c_endpoints;
  PyObject *__pyx_v_endpoint = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[3];
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int64_t __pyx_t_12;
  int64_t __pyx_t_13;
  int64_t __pyx_t_14;
  bool __pyx_t_15;
  std::string __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":940
 *         """
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             vector[CFlightEndpoint] c_endpoints
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L1_error)
  __pyx_v_c_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":943
 *             vector[CFlightEndpoint] c_endpoints
 * 
 *         for endpoint in endpoints:             # <<<<<<<<<<<<<<
 *             if isinstance(endpoint, FlightEndpoint):
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)
*/
  if (likely(PyList_CheckExact(__pyx_v_endpoints)) || PyTuple_CheckExact(__pyx_v_endpoints)) {
    __pyx_t_2 = __pyx_v_endpoints; __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_endpoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __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, 943, __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, 943, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__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, 943, __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, 943, __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, 943, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_endpoint, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":944
 * 
 *         for endpoint in endpoints:
 *             if isinstance(endpoint, FlightEndpoint):             # <<<<<<<<<<<<<<
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)
 *             else:
*/
    __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_endpoint, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint); 
    if (likely(__pyx_t_6)) {

      /* "pyarrow/_flight.pyx":945
 *         for endpoint in endpoints:
 *             if isinstance(endpoint, FlightEndpoint):
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(
*/
      try {
        __pyx_v_c_endpoints.push_back(((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_v_endpoint)->endpoint);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 945, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":944
 * 
 *         for endpoint in endpoints:
 *             if isinstance(endpoint, FlightEndpoint):             # <<<<<<<<<<<<<<
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "pyarrow/_flight.pyx":947
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)
 *             else:
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     f'Endpoint {endpoint} is not instance of FlightEndpoint')
 * 
*/
    /*else*/ {
      __pyx_t_7 = NULL;

      /* "pyarrow/_flight.pyx":948
 *             else:
 *                 raise TypeError(
 *                     f'Endpoint {endpoint} is not instance of FlightEndpoint')             # <<<<<<<<<<<<<<
 * 
 *         check_flight_status(CreateFlightInfo(c_schema,
*/
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_endpoint, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 948, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Endpoint;
      __pyx_t_9[1] = __pyx_t_8;
      __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_is_not_instance_of_FlightEndpoi;
      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 34, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
      if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 948, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 947, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "pyarrow/_flight.pyx":943
 *             vector[CFlightEndpoint] c_endpoints
 * 
 *         for endpoint in endpoints:             # <<<<<<<<<<<<<<
 *             if isinstance(endpoint, FlightEndpoint):
 *                 c_endpoints.push_back((<FlightEndpoint> endpoint).endpoint)
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":953
 *                                              descriptor.descriptor,
 *                                              c_endpoints,
 *                                              total_records if total_records is not None else -1,             # <<<<<<<<<<<<<<
 *                                              total_bytes if total_bytes is not None else -1,
 *                                              ordered,
*/
  __pyx_t_6 = (__pyx_v_total_records != Py_None);
  if (__pyx_t_6) {
    __pyx_t_13 = __Pyx_PyLong_As_int64_t(__pyx_v_total_records); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L1_error)
    __pyx_t_12 = __pyx_t_13;
  } else {
    __pyx_t_12 = -1L;
  }

  /* "pyarrow/_flight.pyx":954
 *                                              c_endpoints,
 *                                              total_records if total_records is not None else -1,
 *                                              total_bytes if total_bytes is not None else -1,             # <<<<<<<<<<<<<<
 *                                              ordered,
 *                                              tobytes(app_metadata), &self.info))
*/
  __pyx_t_6 = (__pyx_v_total_bytes != Py_None);
  if (__pyx_t_6) {
    __pyx_t_14 = __Pyx_PyLong_As_int64_t(__pyx_v_total_bytes); if (unlikely((__pyx_t_14 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 954, __pyx_L1_error)
    __pyx_t_13 = __pyx_t_14;
  } else {
    __pyx_t_13 = -1L;
  }

  /* "pyarrow/_flight.pyx":955
 *                                              total_records if total_records is not None else -1,
 *                                              total_bytes if total_bytes is not None else -1,
 *                                              ordered,             # <<<<<<<<<<<<<<
 *                                              tobytes(app_metadata), &self.info))
 * 
*/
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ordered); if (unlikely((__pyx_t_15 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":956
 *                                              total_bytes if total_bytes is not None else -1,
 *                                              ordered,
 *                                              tobytes(app_metadata), &self.info))             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_5 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
    assert(__pyx_t_5);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_app_metadata};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_16 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":950
 *                     f'Endpoint {endpoint} is not instance of FlightEndpoint')
 * 
 *         check_flight_status(CreateFlightInfo(c_schema,             # <<<<<<<<<<<<<<
 *                                              descriptor.descriptor,
 *                                              c_endpoints,
*/
  __pyx_t_17 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::py::flight::CreateFlightInfo(__pyx_v_c_schema, __pyx_v_descriptor->descriptor, __pyx_v_c_endpoints, __pyx_t_12, __pyx_t_13, __pyx_t_15, __pyx_t_16, (&__pyx_v_self->info))); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 950, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":918
 *         return obj
 * 
 *     def __init__(self, Schema schema, FlightDescriptor descriptor, endpoints,             # <<<<<<<<<<<<<<
 *                  total_records=None, total_bytes=None, ordered=False, app_metadata=""):
 *         """Create a FlightInfo object from a schema, descriptor, and endpoints.
*/

  /* function exit code */
  __pyx_r = 0;
  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);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_endpoint);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":958
 *                                              tobytes(app_metadata), &self.info))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def total_records(self):
 *         """The total record count of this flight, or -1 if unknown."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_13total_records_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_13total_records_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_7pyarrow_7_flight_10FlightInfo_13total_records___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_13total_records___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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);

  /* "pyarrow/_flight.pyx":961
 *     def total_records(self):
 *         """The total record count of this flight, or -1 if unknown."""
 *         return self.info.get().total_records()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_self->info.get()->total_records()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":958
 *                                              tobytes(app_metadata), &self.info))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def total_records(self):
 *         """The total record count of this flight, or -1 if unknown."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.total_records.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":963
 *         return self.info.get().total_records()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def total_bytes(self):
 *         """The size in bytes of the data in this flight, or -1 if unknown."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_11total_bytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_11total_bytes_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_7pyarrow_7_flight_10FlightInfo_11total_bytes___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_11total_bytes___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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);

  /* "pyarrow/_flight.pyx":966
 *     def total_bytes(self):
 *         """The size in bytes of the data in this flight, or -1 if unknown."""
 *         return self.info.get().total_bytes()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int64_t(__pyx_v_self->info.get()->total_bytes()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":963
 *         return self.info.get().total_records()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def total_bytes(self):
 *         """The size in bytes of the data in this flight, or -1 if unknown."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.total_bytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":968
 *         return self.info.get().total_bytes()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ordered(self):
 *         """Whether endpoints are in the same order as the data."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_7ordered_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_7ordered_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_7pyarrow_7_flight_10FlightInfo_7ordered___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_7ordered___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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);

  /* "pyarrow/_flight.pyx":971
 *     def ordered(self):
 *         """Whether endpoints are in the same order as the data."""
 *         return self.info.get().ordered()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->info.get()->ordered()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":968
 *         return self.info.get().total_bytes()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ordered(self):
 *         """Whether endpoints are in the same order as the data."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.ordered.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":973
 *         return self.info.get().ordered()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_12app_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_12app_metadata_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_7pyarrow_7_flight_10FlightInfo_12app_metadata___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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);

  /* "pyarrow/_flight.pyx":985
 * 
 *         """
 *         return self.info.get().app_metadata()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->info.get()->app_metadata()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":973
 *         return self.info.get().ordered()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.app_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":987
 *         return self.info.get().app_metadata()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The schema of the data in this flight."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_6schema_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_7pyarrow_7_flight_10FlightInfo_6schema___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_6schema___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self) {
  std::shared_ptr< arrow::Schema>  __pyx_v_schema;
   arrow::ipc::DictionaryMemo __pyx_v_dummy_memo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":994
 *             CDictionaryMemo dummy_memo
 * 
 *         check_flight_status(self.info.get().GetSchema(&dummy_memo).Value(&schema))             # <<<<<<<<<<<<<<
 *         if schema.get() == NULL:
 *             return None
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->info.get()->GetSchema((&__pyx_v_dummy_memo)).Value((&__pyx_v_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 994, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":995
 * 
 *         check_flight_status(self.info.get().GetSchema(&dummy_memo).Value(&schema))
 *         if schema.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_schema(schema)
*/
  __pyx_t_2 = (__pyx_v_schema.get() == NULL);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":996
 *         check_flight_status(self.info.get().GetSchema(&dummy_memo).Value(&schema))
 *         if schema.get() == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(schema)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":995
 * 
 *         check_flight_status(self.info.get().GetSchema(&dummy_memo).Value(&schema))
 *         if schema.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_schema(schema)
*/
  }

  /* "pyarrow/_flight.pyx":997
 *         if schema.get() == NULL:
 *             return None
 *         return pyarrow_wrap_schema(schema)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_schema); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":987
 *         return self.info.get().app_metadata()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """The schema of the data in this flight."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":999
 *         return pyarrow_wrap_schema(schema)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def descriptor(self):
 *         """The descriptor of the data in this flight."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_10descriptor_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_10descriptor_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_7pyarrow_7_flight_10FlightInfo_10descriptor___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_10descriptor___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_result = 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);

  /* "pyarrow/_flight.pyx":1003
 *         """The descriptor of the data in this flight."""
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *         result.descriptor = self.info.get().descriptor()
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1004
 *         cdef FlightDescriptor result = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor = self.info.get().descriptor()             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->descriptor = __pyx_v_self->info.get()->descriptor();

  /* "pyarrow/_flight.pyx":1005
 *             FlightDescriptor.__new__(FlightDescriptor)
 *         result.descriptor = self.info.get().descriptor()
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":999
 *         return pyarrow_wrap_schema(schema)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def descriptor(self):
 *         """The descriptor of the data in this flight."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.descriptor.__get__", __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;
}

/* "pyarrow/_flight.pyx":1007
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def endpoints(self):
 *         """The endpoints where this flight is available."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_9endpoints_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_9endpoints_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_7pyarrow_7_flight_10FlightInfo_9endpoints___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_9endpoints___get__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self) {
  std::vector< arrow::flight::FlightEndpoint>  __pyx_v_endpoints;
  struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *__pyx_v_py_endpoint = 0;
  PyObject *__pyx_v_result = NULL;
   arrow::flight::FlightEndpoint __pyx_v_endpoint;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::vector< arrow::flight::FlightEndpoint> ::iterator __pyx_t_2;
   arrow::flight::FlightEndpoint __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":1012
 *         # TODO: get Cython to iterate over reference directly
 *         cdef:
 *             vector[CFlightEndpoint] endpoints = self.info.get().endpoints()             # <<<<<<<<<<<<<<
 *             FlightEndpoint py_endpoint
 * 
*/
  __pyx_v_endpoints = __pyx_v_self->info.get()->endpoints();

  /* "pyarrow/_flight.pyx":1015
 *             FlightEndpoint py_endpoint
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         for endpoint in endpoints:
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1016
 * 
 *         result = []
 *         for endpoint in endpoints:             # <<<<<<<<<<<<<<
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *             py_endpoint.endpoint = endpoint
*/
  __pyx_t_2 = __pyx_v_endpoints.begin();
  for (; __pyx_t_2 != __pyx_v_endpoints.end(); ++__pyx_t_2) {
    __pyx_t_3 = *__pyx_t_2;
    __pyx_v_endpoint = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "pyarrow/_flight.pyx":1017
 *         result = []
 *         for endpoint in endpoints:
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)             # <<<<<<<<<<<<<<
 *             py_endpoint.endpoint = endpoint
 *             result.append(py_endpoint)
*/
    __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightEndpoint(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_py_endpoint, ((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":1018
 *         for endpoint in endpoints:
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *             py_endpoint.endpoint = endpoint             # <<<<<<<<<<<<<<
 *             result.append(py_endpoint)
 *         return result
*/
    __pyx_v_py_endpoint->endpoint = __pyx_v_endpoint;

    /* "pyarrow/_flight.pyx":1019
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *             py_endpoint.endpoint = endpoint
 *             result.append(py_endpoint)             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_result, ((PyObject *)__pyx_v_py_endpoint)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1019, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1016
 * 
 *         result = []
 *         for endpoint in endpoints:             # <<<<<<<<<<<<<<
 *             py_endpoint = FlightEndpoint.__new__(FlightEndpoint)
 *             py_endpoint.endpoint = endpoint
*/
  }

  /* "pyarrow/_flight.pyx":1020
 *             py_endpoint.endpoint = endpoint
 *             result.append(py_endpoint)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1007
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def endpoints(self):
 *         """The endpoints where this flight is available."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.endpoints.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_endpoint);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1022
 *         return result
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_3serialize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_10FlightInfo_2serialize, "FlightInfo.serialize(self)\n\nGet the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_10FlightInfo_3serialize = {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_2serialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_3serialize(PyObject *__pyx_v_self, 
#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("serialize (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("serialize", 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("serialize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10FlightInfo_2serialize(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_2serialize(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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("serialize", 0);

  /* "pyarrow/_flight.pyx":1029
 * 
 *         """
 *         return GetResultValue(self.info.get().SerializeToString())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = arrow::py::GetResultValue<std::string>(__pyx_v_self->info.get()->SerializeToString()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1029, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1022
 *         return result
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.serialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1031
 *         return GetResultValue(self.info.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_5deserialize(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_7pyarrow_7_flight_10FlightInfo_4deserialize, "FlightInfo.deserialize(cls, serialized)\n\nParse the wire-format representation of this type.\n\nUseful when interoperating with non-Flight systems (e.g. REST\nservices) that may want to return Flight types.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_10FlightInfo_5deserialize = {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_4deserialize};
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_5deserialize(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_serialized = 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("deserialize (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_serialized,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, 1031, __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, 1031, __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, "deserialize", 0) < (0)) __PYX_ERR(0, 1031, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, i); __PYX_ERR(0, 1031, __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, 1031, __pyx_L3_error)
    }
    __pyx_v_serialized = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("deserialize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1031, __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("pyarrow._flight.FlightInfo.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10FlightInfo_4deserialize(((PyTypeObject*)__pyx_v_cls), __pyx_v_serialized);

  /* 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_7pyarrow_7_flight_10FlightInfo_4deserialize(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_serialized) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_info = 0;
  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;
  std::string __pyx_t_5;
  std::unique_ptr< arrow::flight::FlightInfo>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deserialize", 0);

  /* "pyarrow/_flight.pyx":1039
 * 
 *         """
 *         cdef FlightInfo info = FlightInfo.__new__(FlightInfo)             # <<<<<<<<<<<<<<
 *         info.info = move(GetResultValue(
 *             CFlightInfo.Deserialize(tobytes(serialized))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightInfo(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_info = ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1041
 *         cdef FlightInfo info = FlightInfo.__new__(FlightInfo)
 *         info.info = move(GetResultValue(
 *             CFlightInfo.Deserialize(tobytes(serialized))))             # <<<<<<<<<<<<<<
 *         return info
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __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_v_serialized};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1040
 *         """
 *         cdef FlightInfo info = FlightInfo.__new__(FlightInfo)
 *         info.info = move(GetResultValue(             # <<<<<<<<<<<<<<
 *             CFlightInfo.Deserialize(tobytes(serialized))))
 *         return info
*/
  __pyx_t_6 = arrow::py::GetResultValue<std::unique_ptr< arrow::flight::FlightInfo> >( arrow::flight::FlightInfo::Deserialize(__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1040, __pyx_L1_error)
  __pyx_v_info->info = cython_std::move<std::unique_ptr< arrow::flight::FlightInfo> >(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6));

  /* "pyarrow/_flight.pyx":1042
 *         info.info = move(GetResultValue(
 *             CFlightInfo.Deserialize(tobytes(serialized))))
 *         return info             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, FlightInfo other):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_info);
  __pyx_r = ((PyObject *)__pyx_v_info);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1031
 *         return GetResultValue(self.info.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.deserialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_info);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1044
 *         return info
 * 
 *     def __eq__(self, FlightInfo other):             # <<<<<<<<<<<<<<
 *         return deref(self.info.get()) == deref(other.info.get())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  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_other), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo, 1, "other", 0))) __PYX_ERR(0, 1044, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10FlightInfo_6__eq__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_other));

  /* 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_7pyarrow_7_flight_10FlightInfo_6__eq__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_other) {
  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);

  /* "pyarrow/_flight.pyx":1045
 * 
 *     def __eq__(self, FlightInfo other):
 *         return deref(self.info.get()) == deref(other.info.get())             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((*__pyx_v_self->info.get()) == (*__pyx_v_other->info.get()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1044
 *         return info
 * 
 *     def __eq__(self, FlightInfo other):             # <<<<<<<<<<<<<<
 *         return deref(self.info.get()) == deref(other.info.get())
 * 
*/

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

/* "pyarrow/_flight.pyx":1047
 *         return deref(self.info.get()) == deref(other.info.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "
 *                 f"descriptor={self.descriptor} "
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_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_7pyarrow_7_flight_10FlightInfo_8__repr__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_8__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[15];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":1048
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "             # <<<<<<<<<<<<<<
 *                 f"descriptor={self.descriptor} "
 *                 f"endpoints={self.endpoints} "
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1049
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "
 *                 f"descriptor={self.descriptor} "             # <<<<<<<<<<<<<<
 *                 f"endpoints={self.endpoints} "
 *                 f"total_records={self.total_records} "
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_descriptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1050
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "
 *                 f"descriptor={self.descriptor} "
 *                 f"endpoints={self.endpoints} "             # <<<<<<<<<<<<<<
 *                 f"total_records={self.total_records} "
 *                 f"total_bytes={self.total_bytes} "
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_endpoints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1051
 *                 f"descriptor={self.descriptor} "
 *                 f"endpoints={self.endpoints} "
 *                 f"total_records={self.total_records} "             # <<<<<<<<<<<<<<
 *                 f"total_bytes={self.total_bytes} "
 *                 f"ordered={self.ordered} "
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_total_records); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1052
 *                 f"endpoints={self.endpoints} "
 *                 f"total_records={self.total_records} "
 *                 f"total_bytes={self.total_bytes} "             # <<<<<<<<<<<<<<
 *                 f"ordered={self.ordered} "
 *                 f"app_metadata={self.app_metadata}>")
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_total_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1053
 *                 f"total_records={self.total_records} "
 *                 f"total_bytes={self.total_bytes} "
 *                 f"ordered={self.ordered} "             # <<<<<<<<<<<<<<
 *                 f"app_metadata={self.app_metadata}>")
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ordered); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1054
 *                 f"total_bytes={self.total_bytes} "
 *                 f"ordered={self.ordered} "
 *                 f"app_metadata={self.app_metadata}>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_app_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_pyarrow_flight_FlightInfo_schem;
  __pyx_t_9[1] = __pyx_t_2;
  __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_descriptor_2;
  __pyx_t_9[3] = __pyx_t_3;
  __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_endpoints_2;
  __pyx_t_9[5] = __pyx_t_4;
  __pyx_t_9[6] = __pyx_mstate_global->__pyx_kp_u_total_records_2;
  __pyx_t_9[7] = __pyx_t_5;
  __pyx_t_9[8] = __pyx_mstate_global->__pyx_kp_u_total_bytes_2;
  __pyx_t_9[9] = __pyx_t_6;
  __pyx_t_9[10] = __pyx_mstate_global->__pyx_kp_u_ordered_2;
  __pyx_t_9[11] = __pyx_t_7;
  __pyx_t_9[12] = __pyx_mstate_global->__pyx_kp_u_app_metadata_2;
  __pyx_t_9[13] = __pyx_t_8;
  __pyx_t_9[14] = __pyx_mstate_global->__pyx_kp_u__6;

  /* "pyarrow/_flight.pyx":1048
 * 
 *     def __repr__(self):
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "             # <<<<<<<<<<<<<<
 *                 f"descriptor={self.descriptor} "
 *                 f"endpoints={self.endpoints} "
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_9, 15, 34 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1047
 *         return deref(self.info.get()) == deref(other.info.get())
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return (f"<pyarrow.flight.FlightInfo schema={self.schema} "
 *                 f"descriptor={self.descriptor} "
*/

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__, "FlightInfo.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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.info cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.info cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_info_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightInfo.__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.info cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.info cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__, "FlightInfo.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__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_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__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.info cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.info cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_info_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1062
 *         CFlightStreamChunk chunk
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def data(self):
 *         if self.chunk.data == NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_4data_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_7pyarrow_7_flight_17FlightStreamChunk_4data___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_4data___get__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__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("__get__", 0);

  /* "pyarrow/_flight.pyx":1064
 *     @property
 *     def data(self):
 *         if self.chunk.data == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_batch(self.chunk.data)
*/
  __pyx_t_1 = ((__pyx_v_self->chunk.data == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1065
 *     def data(self):
 *         if self.chunk.data == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_batch(self.chunk.data)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1064
 *     @property
 *     def data(self):
 *         if self.chunk.data == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_batch(self.chunk.data)
*/
  }

  /* "pyarrow/_flight.pyx":1066
 *         if self.chunk.data == NULL:
 *             return None
 *         return pyarrow_wrap_batch(self.chunk.data)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_self->chunk.data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1062
 *         CFlightStreamChunk chunk
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def data(self):
 *         if self.chunk.data == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightStreamChunk.data.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1068
 *         return pyarrow_wrap_batch(self.chunk.data)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         if self.chunk.app_metadata == NULL:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata_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_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata___get__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__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("__get__", 0);

  /* "pyarrow/_flight.pyx":1070
 *     @property
 *     def app_metadata(self):
 *         if self.chunk.app_metadata == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)
*/
  __pyx_t_1 = ((__pyx_v_self->chunk.app_metadata == NULL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1071
 *     def app_metadata(self):
 *         if self.chunk.app_metadata == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1070
 *     @property
 *     def app_metadata(self):
 *         if self.chunk.app_metadata == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)
*/
  }

  /* "pyarrow/_flight.pyx":1072
 *         if self.chunk.app_metadata == NULL:
 *             return None
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_self->chunk.app_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1068
 *         return pyarrow_wrap_batch(self.chunk.data)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def app_metadata(self):
 *         if self.chunk.app_metadata == NULL:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightStreamChunk.app_metadata.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1074
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter((self.data, self.app_metadata))
 * 
*/

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

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk___iter__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__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("__iter__", 0);

  /* "pyarrow/_flight.pyx":1075
 * 
 *     def __iter__(self):
 *         return iter((self.data, self.app_metadata))             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_app_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1075, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 1075, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1074
 *         return pyarrow_wrap_buffer(self.chunk.app_metadata)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter((self.data, self.app_metadata))
 * 
*/

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

/* "pyarrow/_flight.pyx":1077
 *         return iter((self.data, self.app_metadata))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<FlightStreamChunk with data: {self.chunk.data != NULL} with metadata: {self.chunk.app_metadata != NULL}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_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_7pyarrow_7_flight_17FlightStreamChunk_2__repr__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_2__repr__(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3[5];
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/_flight.pyx":1078
 * 
 *     def __repr__(self):
 *         return f"<FlightStreamChunk with data: {self.chunk.data != NULL} with metadata: {self.chunk.app_metadata != NULL}>"             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyUnicode_FromBInt_bool((__pyx_v_self->chunk.data != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FromBInt_bool((__pyx_v_self->chunk.app_metadata != NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_FlightStreamChunk_with_data;
  __pyx_t_3[1] = __pyx_t_1;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_with_metadata;
  __pyx_t_3[3] = __pyx_t_2;
  __pyx_t_3[4] = __pyx_mstate_global->__pyx_kp_u__6;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127);
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1077
 *         return iter((self.data, self.app_metadata))
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return f"<FlightStreamChunk with data: {self.chunk.data != NULL} with metadata: {self.chunk.app_metadata != NULL}>"
 * 
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__, "FlightStreamChunk.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__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.chunk cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.chunk cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_chunk_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightStreamChunk.__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.chunk cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.chunk cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__, "FlightStreamChunk.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightStreamChunk.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__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_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__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.chunk cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.chunk cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_chunk_cannot_be_converted_t, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1090
 *     cdef shared_ptr[CMetadataRecordBatchReader] reader
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

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

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

  /* "pyarrow/_flight.pyx":1091
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1090
 *     cdef shared_ptr[CMetadataRecordBatchReader] reader
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "pyarrow/_flight.pyx":1093
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return self.read_chunk()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_2__next__(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_2__next__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pyarrow/_flight.pyx":1094
 * 
 *     def __next__(self):
 *         return self.read_chunk()             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read_chunk, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1093
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         return self.read_chunk()
 * 
*/

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

/* "pyarrow/_flight.pyx":1096
 *         return self.read_chunk()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """Get the schema for this reader."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema_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_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema___get__(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema___get__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/_flight.pyx":1100
 *         """Get the schema for this reader."""
 *         cdef shared_ptr[CSchema] c_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().GetSchema().Value(&c_schema))
 *         return pyarrow_wrap_schema(c_schema)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1101
 *         cdef shared_ptr[CSchema] c_schema
 *         with nogil:
 *             check_flight_status(self.reader.get().GetSchema().Value(&c_schema))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_schema(c_schema)
 * 
*/
        __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader.get()->GetSchema().Value((&__pyx_v_c_schema))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1101, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1100
 *         """Get the schema for this reader."""
 *         cdef shared_ptr[CSchema] c_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().GetSchema().Value(&c_schema))
 *         return pyarrow_wrap_schema(c_schema)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1102
 *         with nogil:
 *             check_flight_status(self.reader.get().GetSchema().Value(&c_schema))
 *         return pyarrow_wrap_schema(c_schema)             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_c_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1096
 *         return self.read_chunk()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def schema(self):
 *         """Get the schema for this reader."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight._MetadataRecordBatchReader.schema.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1104
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all, "_MetadataRecordBatchReader.read_all(self)\n\nRead the entire contents of the stream as a Table.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all = {"read_all", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all};
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all(PyObject *__pyx_v_self, 
#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("read_all (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("read_all", 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("read_all", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  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("read_all", 0);

  /* "pyarrow/_flight.pyx":1108
 *         cdef:
 *             shared_ptr[CTable] c_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().ToTable().Value(&c_table))
 *         return pyarrow_wrap_table(c_table)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1109
 *             shared_ptr[CTable] c_table
 *         with nogil:
 *             check_flight_status(self.reader.get().ToTable().Value(&c_table))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_table(c_table)
 * 
*/
        __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader.get()->ToTable().Value((&__pyx_v_c_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1109, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1108
 *         cdef:
 *             shared_ptr[CTable] c_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().ToTable().Value(&c_table))
 *         return pyarrow_wrap_table(c_table)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1110
 *         with nogil:
 *             check_flight_status(self.reader.get().ToTable().Value(&c_table))
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def read_chunk(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1104
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight._MetadataRecordBatchReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1112
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def read_chunk(self):             # <<<<<<<<<<<<<<
 *         """Read the next FlightStreamChunk along with any metadata.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk, "_MetadataRecordBatchReader.read_chunk(self)\n\nRead the next FlightStreamChunk along with any metadata.\n\nReturns\n-------\nchunk : FlightStreamChunk\n    The next FlightStreamChunk in the stream.\n\nRaises\n------\nStopIteration\n    when the stream is finished");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk = {"read_chunk", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk};
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk(PyObject *__pyx_v_self, 
#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("read_chunk (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("read_chunk", 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("read_chunk", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *__pyx_v_chunk = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_chunk", 0);

  /* "pyarrow/_flight.pyx":1126
 *         """
 *         cdef:
 *             FlightStreamChunk chunk = FlightStreamChunk()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_chunk = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1128
 *             FlightStreamChunk chunk = FlightStreamChunk()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().Next().Value(&chunk.chunk))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1129
 * 
 *         with nogil:
 *             check_flight_status(self.reader.get().Next().Value(&chunk.chunk))             # <<<<<<<<<<<<<<
 * 
 *         if chunk.chunk.data == NULL and chunk.chunk.app_metadata == NULL:
*/
        __pyx_t_4 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader.get()->Next().Value((&__pyx_v_chunk->chunk))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1129, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1128
 *             FlightStreamChunk chunk = FlightStreamChunk()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().Next().Value(&chunk.chunk))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1131
 *             check_flight_status(self.reader.get().Next().Value(&chunk.chunk))
 * 
 *         if chunk.chunk.data == NULL and chunk.chunk.app_metadata == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
*/
  __pyx_t_6 = ((__pyx_v_chunk->chunk.data == NULL) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_6 = ((__pyx_v_chunk->chunk.app_metadata == NULL) != 0);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L7_bool_binop_done:;
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/_flight.pyx":1132
 * 
 *         if chunk.chunk.data == NULL and chunk.chunk.app_metadata == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return chunk
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_StopIteration))), 0, 0, 0);
    __PYX_ERR(0, 1132, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1131
 *             check_flight_status(self.reader.get().Next().Value(&chunk.chunk))
 * 
 *         if chunk.chunk.data == NULL and chunk.chunk.app_metadata == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
*/
  }

  /* "pyarrow/_flight.pyx":1134
 *             raise StopIteration
 * 
 *         return chunk             # <<<<<<<<<<<<<<
 * 
 *     def to_reader(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_chunk);
  __pyx_r = ((PyObject *)__pyx_v_chunk);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1112
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def read_chunk(self):             # <<<<<<<<<<<<<<
 *         """Read the next FlightStreamChunk along with any metadata.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight._MetadataRecordBatchReader.read_chunk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1136
 *         return chunk
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Convert this reader into a regular RecordBatchReader.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader, "_MetadataRecordBatchReader.to_reader(self)\n\nConvert this reader into a regular RecordBatchReader.\n\nThis may fail if the schema cannot be read from the remote end.\n\nReturns\n-------\nRecordBatchReader");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader = {"to_reader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader};
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader(PyObject *__pyx_v_self, 
#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_reader (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_reader", 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_reader", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *__pyx_v_reader = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  std::shared_ptr< arrow::RecordBatchReader>  __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_reader", 0);

  /* "pyarrow/_flight.pyx":1146
 *         """
 *         cdef RecordBatchReader reader
 *         reader = RecordBatchReader.__new__(RecordBatchReader)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             reader.reader = GetResultValue(MakeRecordBatchReader(self.reader))
*/
  __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader), __pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader)))) __PYX_ERR(0, 1146, __pyx_L1_error)
  __pyx_v_reader = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1147
 *         cdef RecordBatchReader reader
 *         reader = RecordBatchReader.__new__(RecordBatchReader)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader.reader = GetResultValue(MakeRecordBatchReader(self.reader))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1148
 *         reader = RecordBatchReader.__new__(RecordBatchReader)
 *         with nogil:
 *             reader.reader = GetResultValue(MakeRecordBatchReader(self.reader))             # <<<<<<<<<<<<<<
 * 
 *         return reader
*/
        __pyx_t_2 = arrow::py::GetResultValue<std::shared_ptr< arrow::RecordBatchReader> >( arrow::flight::MakeRecordBatchReader(__pyx_v_self->reader)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1148, __pyx_L4_error)
        __pyx_v_reader->reader = __PYX_STD_MOVE_IF_SUPPORTED(((arrow::py::SharedPtrNoGIL< arrow::RecordBatchReader> )__pyx_t_2));
      }

      /* "pyarrow/_flight.pyx":1147
 *         cdef RecordBatchReader reader
 *         reader = RecordBatchReader.__new__(RecordBatchReader)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             reader.reader = GetResultValue(MakeRecordBatchReader(self.reader))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1150
 *             reader.reader = GetResultValue(MakeRecordBatchReader(self.reader))
 * 
 *         return reader             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_reader);
  __pyx_r = ((PyObject *)__pyx_v_reader);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1136
 *         return chunk
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Convert this reader into a regular RecordBatchReader.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight._MetadataRecordBatchReader.to_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1152
 *         return reader
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stats(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats_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_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats___get__(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats___get__(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__get__", 0);

  /* "pyarrow/_flight.pyx":1161
 *         ReadStats
 *         """
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Operation on closed reader")
 *         return _wrap_read_stats((<CMetadataRecordBatchReader*> self.reader.get()).stats())
*/
  __pyx_t_1 = ((!__pyx_v_self->reader) != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":1162
 *         """
 *         if not self.reader:
 *             raise ValueError("Operation on closed reader")             # <<<<<<<<<<<<<<
 *         return _wrap_read_stats((<CMetadataRecordBatchReader*> self.reader.get()).stats())
 * 
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Operation_on_closed_reader};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __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, 1162, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1161
 *         ReadStats
 *         """
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Operation on closed reader")
 *         return _wrap_read_stats((<CMetadataRecordBatchReader*> self.reader.get()).stats())
*/
  }

  /* "pyarrow/_flight.pyx":1163
 *         if not self.reader:
 *             raise ValueError("Operation on closed reader")
 *         return _wrap_read_stats((<CMetadataRecordBatchReader*> self.reader.get()).stats())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__wrap_read_stats((( arrow::flight::MetadataRecordBatchReader *)__pyx_v_self->reader.get())->stats()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1152
 *         return reader
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stats(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight._MetadataRecordBatchReader.stats.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__, "_MetadataRecordBatchReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight._MetadataRecordBatchReader.__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_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__, "_MetadataRecordBatchReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight._MetadataRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)__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_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight._MetadataRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __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_7pyarrow_7_flight_25MetadataRecordBatchReader_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__, "MetadataRecordBatchReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchReader_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_1__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_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.MetadataRecordBatchReader.__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_7pyarrow_7_flight_25MetadataRecordBatchReader_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__, "MetadataRecordBatchReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchReader_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_3__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("pyarrow._flight.MetadataRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)__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_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.MetadataRecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1178
 *     """A reader that can also be canceled."""
 * 
 *     def cancel(self):             # <<<<<<<<<<<<<<
 *         """Cancel the read operation."""
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_1cancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamReader_cancel, "FlightStreamReader.cancel(self)\n\nCancel the read operation.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_1cancel = {"cancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_1cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_cancel};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_1cancel(PyObject *__pyx_v_self, 
#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("cancel (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("cancel", 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("cancel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18FlightStreamReader_cancel(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_cancel(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cancel", 0);

  /* "pyarrow/_flight.pyx":1180
 *     def cancel(self):
 *         """Cancel the read operation."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1181
 *         """Cancel the read operation."""
 *         with nogil:
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()             # <<<<<<<<<<<<<<
 * 
 *     def read_all(self):
*/
        (( arrow::flight::FlightStreamReader *)__pyx_v_self->__pyx_base.__pyx_base.reader.get())->Cancel();
      }

      /* "pyarrow/_flight.pyx":1180
 *     def cancel(self):
 *         """Cancel the read operation."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1178
 *     """A reader that can also be canceled."""
 * 
 *     def cancel(self):             # <<<<<<<<<<<<<<
 *         """Cancel the read operation."""
 *         with nogil:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1183
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_3read_all(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamReader_2read_all, "FlightStreamReader.read_all(self)\n\nRead the entire contents of the stream as a Table.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_3read_all = {"read_all", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_3read_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_2read_all};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_3read_all(PyObject *__pyx_v_self, 
#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("read_all (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("read_all", 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("read_all", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18FlightStreamReader_2read_all(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_2read_all(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_self) {
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
  arrow::StopToken __pyx_v_stop_token;
  PyObject *__pyx_v_stop_handler = NULL;
  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;
  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;
  arrow::StopToken __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/_flight.pyx":1188
 *             shared_ptr[CTable] c_table
 *             CStopToken stop_token
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
*/
  /*with:*/ {
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SignalStopHandler); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __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, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__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, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1188, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_4 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_6 = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {
          __pyx_v_stop_handler = __pyx_t_6;
          __pyx_t_6 = 0;

          /* "pyarrow/_flight.pyx":1189
 *             CStopToken stop_token
 *         with SignalStopHandler() as stop_handler:
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_flight_status(
*/
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stop_handler, __pyx_mstate_global->__pyx_n_u_stop_token); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = ((struct __pyx_obj_7pyarrow_3lib_StopToken *)__pyx_t_6)->stop_token;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_v_stop_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);

          /* "pyarrow/_flight.pyx":1190
 *         with SignalStopHandler() as stop_handler:
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     (<CFlightStreamReader*> self.reader.get())
*/
          {
              PyThreadState * _save;
              _save = PyEval_SaveThread();
              __Pyx_FastGIL_Remember();
              /*try:*/ {

                /* "pyarrow/_flight.pyx":1191
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
 *                 check_flight_status(             # <<<<<<<<<<<<<<
 *                     (<CFlightStreamReader*> self.reader.get())
 *                     .ToTableWithStopToken(stop_token).Value(&c_table))
*/
                __pyx_t_11 = __pyx_f_7pyarrow_7_flight_check_flight_status((( arrow::flight::FlightStreamReader *)__pyx_v_self->__pyx_base.__pyx_base.reader.get())-> ToTable(__pyx_v_stop_token).Value((&__pyx_v_c_table))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1191, __pyx_L14_error)
              }

              /* "pyarrow/_flight.pyx":1190
 *         with SignalStopHandler() as stop_handler:
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     (<CFlightStreamReader*> self.reader.get())
*/
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L15;
                }
                __pyx_L14_error: {
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L7_error;
                }
                __pyx_L15:;
              }
          }

          /* "pyarrow/_flight.pyx":1188
 *             shared_ptr[CTable] c_table
 *             CStopToken stop_token
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
*/
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L12_try_end;
        __pyx_L7_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_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow._flight.FlightStreamReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1188, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1188, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_13 < (0)) __PYX_ERR(0, 1188, __pyx_L9_except_error)
          __pyx_t_14 = (!__pyx_t_13);
          if (unlikely(__pyx_t_14)) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_3);
            __pyx_t_6 = 0;  __pyx_t_1 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(0, 1188, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L12_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3], NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "pyarrow/_flight.pyx":1194
 *                     (<CFlightStreamReader*> self.reader.get())
 *                     .ToTableWithStopToken(stop_token).Value(&c_table))
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1183
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._flight.FlightStreamReader.read_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stop_handler);
  __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_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__, "FlightStreamReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightStreamReader.__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_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__, "FlightStreamReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.FlightStreamReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__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_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightStreamReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1203
 *     """
 * 
 *     cdef CMetadataRecordBatchWriter* _writer(self) nogil:             # <<<<<<<<<<<<<<
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
*/

static  arrow::flight::MetadataRecordBatchWriter *__pyx_f_7pyarrow_7_flight_25MetadataRecordBatchWriter__writer(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self) {
   arrow::flight::MetadataRecordBatchWriter *__pyx_r;

  /* "pyarrow/_flight.pyx":1204
 * 
 *     cdef CMetadataRecordBatchWriter* _writer(self) nogil:
 *         return <CMetadataRecordBatchWriter*> self.writer.get()             # <<<<<<<<<<<<<<
 * 
 *     def begin(self, schema: Schema, options=None):
*/
  __pyx_r = (( arrow::flight::MetadataRecordBatchWriter *)__pyx_v_self->__pyx_base.writer.get());
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1203
 *     """
 * 
 *     cdef CMetadataRecordBatchWriter* _writer(self) nogil:             # <<<<<<<<<<<<<<
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
*/

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

/* "pyarrow/_flight.pyx":1206
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
 *     def begin(self, schema: Schema, options=None):             # <<<<<<<<<<<<<<
 *         """Prepare to write data to this stream with the given schema."""
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin, "MetadataRecordBatchWriter.begin(self, Schema schema: Schema, options=None)\n\nPrepare to write data to this stream with the given schema.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin = {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin(PyObject *__pyx_v_self, 
#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_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  PyObject *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("begin (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_schema,&__pyx_mstate_global->__pyx_n_u_options,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, 1206, __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, 1206, __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, 1206, __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, "begin", 0) < (0)) __PYX_ERR(0, 1206, __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("begin", 0, 1, 2, i); __PYX_ERR(0, 1206, __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, 1206, __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, 1206, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[0]);
    __pyx_v_options = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("begin", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1206, __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("pyarrow._flight.MetadataRecordBatchWriter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self), __pyx_v_schema, __pyx_v_options);

  /* 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_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, PyObject *__pyx_v_options) {
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
   arrow::ipc::IpcWriteOptions __pyx_v_c_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
   arrow::ipc::IpcWriteOptions __pyx_t_3;
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("begin", 0);

  /* "pyarrow/_flight.pyx":1209
 *         """Prepare to write data to this stream with the given schema."""
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             CIpcWriteOptions c_options = _get_options(options).c_options
 *         with nogil:
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1209, __pyx_L1_error)
  __pyx_v_c_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":1210
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)
 *             CIpcWriteOptions c_options = _get_options(options).c_options             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_7_flight__get_options(__pyx_v_options)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_2)->c_options;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_flight.pyx":1211
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)
 *             CIpcWriteOptions c_options = _get_options(options).c_options
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1212
 *             CIpcWriteOptions c_options = _get_options(options).c_options
 *         with nogil:
 *             check_flight_status(self._writer().Begin(c_schema, c_options))             # <<<<<<<<<<<<<<
 * 
 *     def write_metadata(self, buf):
*/
        __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1212, __pyx_L4_error)
        __pyx_t_5 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_4->Begin(__pyx_v_c_schema, __pyx_v_c_options)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1212, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1211
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)
 *             CIpcWriteOptions c_options = _get_options(options).c_options
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1206
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
 *     def begin(self, schema: Schema, options=None):             # <<<<<<<<<<<<<<
 *         """Prepare to write data to this stream with the given schema."""
 *         cdef:
*/

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

/* "pyarrow/_flight.pyx":1214
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
 * 
 *     def write_metadata(self, buf):             # <<<<<<<<<<<<<<
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata, "MetadataRecordBatchWriter.write_metadata(self, buf)\n\nWrite Flight metadata by itself.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata = {"write_metadata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata(PyObject *__pyx_v_self, 
#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_buf = 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_metadata (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_buf,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, 1214, __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, 1214, __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_metadata", 0) < (0)) __PYX_ERR(0, 1214, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_metadata", 1, 1, 1, i); __PYX_ERR(0, 1214, __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, 1214, __pyx_L3_error)
    }
    __pyx_v_buf = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_metadata", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1214, __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("pyarrow._flight.MetadataRecordBatchWriter.write_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self), __pyx_v_buf);

  /* 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_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_buf) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_c_buf;
  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;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_metadata", 0);

  /* "pyarrow/_flight.pyx":1216
 *     def write_metadata(self, buf):
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __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_v_buf};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_buf = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":1217
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteMetadata(c_buf))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1219
 *         with nogil:
 *             check_flight_status(
 *                 self._writer().WriteMetadata(c_buf))             # <<<<<<<<<<<<<<
 * 
 *     def write_batch(self, RecordBatch batch):
*/
        __pyx_t_6 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1219, __pyx_L4_error)

        /* "pyarrow/_flight.pyx":1218
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self._writer().WriteMetadata(c_buf))
 * 
*/
        __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_6->WriteMetadata(__pyx_v_c_buf)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1218, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1217
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteMetadata(c_buf))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1214
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
 * 
 *     def write_metadata(self, buf):             # <<<<<<<<<<<<<<
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.write_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1221
 *                 self._writer().WriteMetadata(c_buf))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch, "MetadataRecordBatchWriter.write_batch(self, RecordBatch batch)\n\nWrite RecordBatch to stream.\n\nParameters\n----------\nbatch : RecordBatch");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch = {"write_batch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch(PyObject *__pyx_v_self, 
#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_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 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_batch (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_batch,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, 1221, __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, 1221, __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_batch", 0) < (0)) __PYX_ERR(0, 1221, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_batch", 1, 1, 1, i); __PYX_ERR(0, 1221, __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, 1221, __pyx_L3_error)
    }
    __pyx_v_batch = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_batch", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1221, __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("pyarrow._flight.MetadataRecordBatchWriter.write_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(0, 1221, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self), __pyx_v_batch);

  /* 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_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch) {
  std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_v_custom_metadata;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_batch", 0);

  /* "pyarrow/_flight.pyx":1238
 *         # individual batches to have control.
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1240
 *         with nogil:
 *             check_flight_status(
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))             # <<<<<<<<<<<<<<
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1240, __pyx_L4_error)

        /* "pyarrow/_flight.pyx":1239
 * 
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
 * 
*/
        __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_1->WriteRecordBatch((*__pyx_v_batch->batch), __pyx_v_custom_metadata)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1239, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1238
 *         # individual batches to have control.
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1221
 *                 self._writer().WriteMetadata(c_buf))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.write_batch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1242
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_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_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table, "MetadataRecordBatchWriter.write_table(self, Table table, max_chunksize=None, **kwargs)\n\nWrite Table to stream in (contiguous) RecordBatch objects.\n\nParameters\n----------\ntable : Table\nmax_chunksize : int, default None\n    Maximum number of rows for RecordBatch chunks. Individual chunks may\n    be smaller depending on the chunk layout of individual columns.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_table = {"write_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_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_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_max_chunksize = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[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_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);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_table,&__pyx_mstate_global->__pyx_n_u_max_chunksize,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, 1242, __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, 1242, __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, 1242, __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, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "write_table", 1) < (0)) __PYX_ERR(0, 1242, __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("write_table", 0, 1, 2, i); __PYX_ERR(0, 1242, __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, 1242, __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, 1242, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[0]);
    __pyx_v_max_chunksize = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_table", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1242, __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_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Table, 1, "table", 0))) __PYX_ERR(0, 1242, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self), __pyx_v_table, __pyx_v_max_chunksize, __pyx_v_kwargs);

  /* 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_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_max_chunksize, PyObject *__pyx_v_kwargs) {
  int64_t __pyx_v_c_max_chunksize;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int64_t __pyx_t_7;
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_table", 0);
  __Pyx_INCREF(__pyx_v_max_chunksize);

  /* "pyarrow/_flight.pyx":1255
 *         cdef:
 *             # max_chunksize must be > 0 to have any impact
 *             int64_t c_max_chunksize = -1             # <<<<<<<<<<<<<<
 * 
 *         if 'chunksize' in kwargs:
*/
  __pyx_v_c_max_chunksize = -1L;

  /* "pyarrow/_flight.pyx":1257
 *             int64_t c_max_chunksize = -1
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '
*/
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_mstate_global->__pyx_n_u_chunksize, __pyx_v_kwargs, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1258
 * 
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']             # <<<<<<<<<<<<<<
 *             msg = ('The parameter chunksize is deprecated for the write_table '
 *                    'methods as of 0.15, please use parameter '
*/
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_mstate_global->__pyx_n_u_chunksize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_max_chunksize, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":1259
 *         if 'chunksize' in kwargs:
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '             # <<<<<<<<<<<<<<
 *                    'methods as of 0.15, please use parameter '
 *                    'max_chunksize instead')
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_The_parameter_chunksize_is_depre);
    __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_The_parameter_chunksize_is_depre;

    /* "pyarrow/_flight.pyx":1262
 *                    'methods as of 0.15, please use parameter '
 *                    'max_chunksize instead')
 *             warnings.warn(msg, FutureWarning)             # <<<<<<<<<<<<<<
 * 
 *         if max_chunksize is not None:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __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[3] = {__pyx_t_3, __pyx_v_msg, ((PyObject *)(((PyTypeObject*)PyExc_FutureWarning)))};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":1257
 *             int64_t c_max_chunksize = -1
 * 
 *         if 'chunksize' in kwargs:             # <<<<<<<<<<<<<<
 *             max_chunksize = kwargs['chunksize']
 *             msg = ('The parameter chunksize is deprecated for the write_table '
*/
  }

  /* "pyarrow/_flight.pyx":1264
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
*/
  __pyx_t_1 = (__pyx_v_max_chunksize != Py_None);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1265
 * 
 *         if max_chunksize is not None:
 *             c_max_chunksize = max_chunksize             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
    __pyx_t_7 = __Pyx_PyLong_As_int64_t(__pyx_v_max_chunksize); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1265, __pyx_L1_error)
    __pyx_v_c_max_chunksize = __pyx_t_7;

    /* "pyarrow/_flight.pyx":1264
 *             warnings.warn(msg, FutureWarning)
 * 
 *         if max_chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_max_chunksize = max_chunksize
 * 
*/
  }

  /* "pyarrow/_flight.pyx":1267
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1269
 *         with nogil:
 *             check_flight_status(
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
*/
        __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1269, __pyx_L6_error)

        /* "pyarrow/_flight.pyx":1268
 * 
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
 * 
*/
        __pyx_t_9 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_8->WriteTable((__pyx_v_table->table[0]), __pyx_v_c_max_chunksize)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1268, __pyx_L6_error)
      }

      /* "pyarrow/_flight.pyx":1267
 *             c_max_chunksize = max_chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pyarrow/_flight.pyx":1242
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_max_chunksize);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1271
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close, "MetadataRecordBatchWriter.close(self)\n\nClose stream and write end-of-stream 0 marker.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close = {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("close", 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("close", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/_flight.pyx":1275
 *         Close stream and write end-of-stream 0 marker.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self._writer().Close())
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1276
 *         """
 *         with nogil:
 *             check_flight_status(self._writer().Close())             # <<<<<<<<<<<<<<
 * 
 *     def write_with_metadata(self, RecordBatch batch, buf):
*/
        __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1276, __pyx_L4_error)
        __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_1->Close()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1276, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1275
 *         Close stream and write end-of-stream 0 marker.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self._writer().Close())
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1271
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker.
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1278
 *             check_flight_status(self._writer().Close())
 * 
 *     def write_with_metadata(self, RecordBatch batch, buf):             # <<<<<<<<<<<<<<
 *         """Write a RecordBatch along with Flight metadata.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata, "MetadataRecordBatchWriter.write_with_metadata(self, RecordBatch batch, buf)\n\nWrite a RecordBatch along with Flight metadata.\n\nParameters\n----------\nbatch : RecordBatch\n    The next RecordBatch in the stream.\nbuf : Buffer\n    Application-specific metadata for the batch as defined by\n    Flight.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata = {"write_with_metadata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata(PyObject *__pyx_v_self, 
#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_7pyarrow_3lib_RecordBatch *__pyx_v_batch = 0;
  PyObject *__pyx_v_buf = 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_with_metadata (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_batch,&__pyx_mstate_global->__pyx_n_u_buf,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, 1278, __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, 1278, __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, 1278, __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_with_metadata", 0) < (0)) __PYX_ERR(0, 1278, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_with_metadata", 1, 2, 2, i); __PYX_ERR(0, 1278, __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, 1278, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1278, __pyx_L3_error)
    }
    __pyx_v_batch = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)values[0]);
    __pyx_v_buf = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_with_metadata", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1278, __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("pyarrow._flight.MetadataRecordBatchWriter.write_with_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_batch), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatch, 1, "batch", 0))) __PYX_ERR(0, 1278, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self), __pyx_v_batch, __pyx_v_buf);

  /* 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_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch, PyObject *__pyx_v_buf) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_c_buf;
  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;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
   arrow::flight::MetadataRecordBatchWriter *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_with_metadata", 0);

  /* "pyarrow/_flight.pyx":1289
 *             Flight.
 *         """
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __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_v_buf};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_buf = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":1290
 *         """
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteWithMetadata(deref(batch.batch), c_buf))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1292
 *         with nogil:
 *             check_flight_status(
 *                 self._writer().WriteWithMetadata(deref(batch.batch), c_buf))             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_6 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self->__pyx_vtab)->_writer(__pyx_v_self); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 1292, __pyx_L4_error)

        /* "pyarrow/_flight.pyx":1291
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self._writer().WriteWithMetadata(deref(batch.batch), c_buf))
 * 
*/
        __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_6->WriteWithMetadata((*__pyx_v_batch->batch), __pyx_v_c_buf)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1291, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1290
 *         """
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self._writer().WriteWithMetadata(deref(batch.batch), c_buf))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1278
 *             check_flight_status(self._writer().Close())
 * 
 *     def write_with_metadata(self, RecordBatch batch, buf):             # <<<<<<<<<<<<<<
 *         """Write a RecordBatch along with Flight metadata.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.MetadataRecordBatchWriter.write_with_metadata", __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.writer cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__, "MetadataRecordBatchWriter.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.MetadataRecordBatchWriter.__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_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__, "MetadataRecordBatchWriter.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.MetadataRecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__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_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.MetadataRecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1298
 *     """A writer that also allows closing the write side of a stream."""
 * 
 *     def done_writing(self):             # <<<<<<<<<<<<<<
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_1done_writing(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_done_writing, "FlightStreamWriter.done_writing(self)\n\nIndicate that the client is done writing, but not done reading.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_1done_writing = {"done_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_1done_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_done_writing};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_1done_writing(PyObject *__pyx_v_self, 
#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_writing (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_writing", 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_writing", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_done_writing(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_done_writing(struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done_writing", 0);

  /* "pyarrow/_flight.pyx":1300
 *     def done_writing(self):
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 (<CFlightStreamWriter*> self.writer.get()).DoneWriting())
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1301
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 (<CFlightStreamWriter*> self.writer.get()).DoneWriting())
 * 
*/
        __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status((( arrow::flight::FlightStreamWriter *)__pyx_v_self->__pyx_base.__pyx_base.writer.get())->DoneWriting()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1301, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1300
 *     def done_writing(self):
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 (<CFlightStreamWriter*> self.writer.get()).DoneWriting())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1298
 *     """A writer that also allows closing the write side of a stream."""
 * 
 *     def done_writing(self):             # <<<<<<<<<<<<<<
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightStreamWriter.done_writing", __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.writer cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__, "FlightStreamWriter.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightStreamWriter.__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_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__, "FlightStreamWriter.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.FlightStreamWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)__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_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightStreamWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1311
 *         unique_ptr[CFlightMetadataReader] reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         """Read the next metadata message."""
 *         cdef shared_ptr[CBuffer] buf
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_1read(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_read, "FlightMetadataReader.read(self)\n\nRead the next metadata message.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_1read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_read};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_1read(PyObject *__pyx_v_self, 
#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("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);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read", 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("read", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_read(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_read(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__pyx_v_self) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/_flight.pyx":1314
 *         """Read the next metadata message."""
 *         cdef shared_ptr[CBuffer] buf
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))
 *         if buf == NULL:
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1315
 *         cdef shared_ptr[CBuffer] buf
 *         with nogil:
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))             # <<<<<<<<<<<<<<
 *         if buf == NULL:
 *             return None
*/
        __pyx_t_1 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader.get()->ReadMetadata((&__pyx_v_buf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1315, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1314
 *         """Read the next metadata message."""
 *         cdef shared_ptr[CBuffer] buf
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))
 *         if buf == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1316
 *         with nogil:
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_buffer(buf)
*/
  __pyx_t_2 = ((__pyx_v_buf == NULL) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1317
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))
 *         if buf == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(buf)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1316
 *         with nogil:
 *             check_flight_status(self.reader.get().ReadMetadata(&buf))
 *         if buf == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         return pyarrow_wrap_buffer(buf)
*/
  }

  /* "pyarrow/_flight.pyx":1318
 *         if buf == NULL:
 *             return None
 *         return pyarrow_wrap_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1311
 *         unique_ptr[CFlightMetadataReader] reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         """Read the next metadata message."""
 *         cdef shared_ptr[CBuffer] buf
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightMetadataReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__, "FlightMetadataReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightMetadataReader.__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_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__, "FlightMetadataReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.FlightMetadataReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)__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_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightMetadataReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1327
 *         unique_ptr[CFlightMetadataWriter] writer
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         """Write the next metadata message.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_1write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_write, "FlightMetadataWriter.write(self, message)\n\nWrite the next metadata message.\n\nParameters\n----------\nmessage : Buffer");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_1write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_write};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_1write(PyObject *__pyx_v_self, 
#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_message = 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_message,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, 1327, __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, 1327, __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, 1327, __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, 1327, __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, 1327, __pyx_L3_error)
    }
    __pyx_v_message = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1327, __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("pyarrow._flight.FlightMetadataWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_write(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)__pyx_v_self), __pyx_v_message);

  /* 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_7pyarrow_7_flight_20FlightMetadataWriter_write(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_self, PyObject *__pyx_v_message) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  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;
  std::shared_ptr< arrow::Buffer>  __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/_flight.pyx":1335
 *         """
 *         cdef shared_ptr[CBuffer] buf = \
 *             pyarrow_unwrap_buffer(as_buffer(message))             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(self.writer.get().WriteMetadata(deref(buf)))
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __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_v_message};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":1336
 *         cdef shared_ptr[CBuffer] buf = \
 *             pyarrow_unwrap_buffer(as_buffer(message))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.writer.get().WriteMetadata(deref(buf)))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1337
 *             pyarrow_unwrap_buffer(as_buffer(message))
 *         with nogil:
 *             check_flight_status(self.writer.get().WriteMetadata(deref(buf)))             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->writer.get()->WriteMetadata((*__pyx_v_buf))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1337, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1336
 *         cdef shared_ptr[CBuffer] buf = \
 *             pyarrow_unwrap_buffer(as_buffer(message))
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.writer.get().WriteMetadata(deref(buf)))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1327
 *         unique_ptr[CFlightMetadataWriter] writer
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         """Write the next metadata message.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightMetadataWriter.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, "self.writer cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__, "FlightMetadataWriter.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightMetadataWriter.__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_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__, "FlightMetadataWriter.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.FlightMetadataWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)__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_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.FlightMetadataWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1343
 *     """State for an async RPC using asyncio."""
 * 
 *     def __init__(self) -> None:             # <<<<<<<<<<<<<<
 *         import asyncio
 *         self._future = asyncio.get_running_loop().create_future()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_11AsyncioCall___init__, "AsyncioCall.__init__(self) -> None");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11AsyncioCall_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11AsyncioCall_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11AsyncioCall___init__};
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #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("__init__ (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_self,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, 1343, __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, 1343, __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, 1343, __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, 1343, __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, 1343, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1343, __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("pyarrow._flight.AsyncioCall.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_11AsyncioCall___init__(__pyx_self, __pyx_v_self);

  /* 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_7pyarrow_7_flight_11AsyncioCall___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_asyncio = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":1344
 * 
 *     def __init__(self) -> None:
 *         import asyncio             # <<<<<<<<<<<<<<
 *         self._future = asyncio.get_running_loop().create_future()
 * 
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_asyncio, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_asyncio = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1345
 *     def __init__(self) -> None:
 *         import asyncio
 *         self._future = asyncio.get_running_loop().create_future()             # <<<<<<<<<<<<<<
 * 
 *     def as_awaitable(self) -> object:
*/
  __pyx_t_5 = __pyx_v_asyncio;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_running_loop, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create_future, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__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_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_future, __pyx_t_1) < (0)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1343
 *     """State for an async RPC using asyncio."""
 * 
 *     def __init__(self) -> None:             # <<<<<<<<<<<<<<
 *         import asyncio
 *         self._future = asyncio.get_running_loop().create_future()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioCall.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_asyncio);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1347
 *         self._future = asyncio.get_running_loop().create_future()
 * 
 *     def as_awaitable(self) -> object:             # <<<<<<<<<<<<<<
 *         return self._future
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_3as_awaitable(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_7pyarrow_7_flight_11AsyncioCall_2as_awaitable, "AsyncioCall.as_awaitable(self) -> object");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11AsyncioCall_3as_awaitable = {"as_awaitable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11AsyncioCall_3as_awaitable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11AsyncioCall_2as_awaitable};
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_3as_awaitable(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("as_awaitable (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_self,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, 1347, __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, 1347, __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, "as_awaitable", 0) < (0)) __PYX_ERR(0, 1347, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("as_awaitable", 1, 1, 1, i); __PYX_ERR(0, 1347, __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, 1347, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("as_awaitable", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1347, __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("pyarrow._flight.AsyncioCall.as_awaitable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_11AsyncioCall_2as_awaitable(__pyx_self, __pyx_v_self);

  /* 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_7pyarrow_7_flight_11AsyncioCall_2as_awaitable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("as_awaitable", 0);

  /* "pyarrow/_flight.pyx":1348
 * 
 *     def as_awaitable(self) -> object:
 *         return self._future             # <<<<<<<<<<<<<<
 * 
 *     def wakeup(self, result_or_exception) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_future); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1347
 *         self._future = asyncio.get_running_loop().create_future()
 * 
 *     def as_awaitable(self) -> object:             # <<<<<<<<<<<<<<
 *         return self._future
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioCall.as_awaitable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1350
 *         return self._future
 * 
 *     def wakeup(self, result_or_exception) -> None:             # <<<<<<<<<<<<<<
 *         # Mark the Future done from within its loop (asyncio
 *         # objects are generally not thread-safe)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_5wakeup(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_7pyarrow_7_flight_11AsyncioCall_4wakeup, "AsyncioCall.wakeup(self, result_or_exception) -> None");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11AsyncioCall_5wakeup = {"wakeup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11AsyncioCall_5wakeup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11AsyncioCall_4wakeup};
static PyObject *__pyx_pw_7pyarrow_7_flight_11AsyncioCall_5wakeup(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_result_or_exception = 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("wakeup (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_self,&__pyx_mstate_global->__pyx_n_u_result_or_exception,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, 1350, __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, 1350, __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, 1350, __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, "wakeup", 0) < (0)) __PYX_ERR(0, 1350, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("wakeup", 1, 2, 2, i); __PYX_ERR(0, 1350, __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, 1350, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1350, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_result_or_exception = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wakeup", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1350, __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("pyarrow._flight.AsyncioCall.wakeup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_11AsyncioCall_4wakeup(__pyx_self, __pyx_v_self, __pyx_v_result_or_exception);

  /* 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_7pyarrow_7_flight_11AsyncioCall_4wakeup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_result_or_exception) {
  PyObject *__pyx_v_loop = NULL;
  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_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wakeup", 0);

  /* "pyarrow/_flight.pyx":1353
 *         # Mark the Future done from within its loop (asyncio
 *         # objects are generally not thread-safe)
 *         loop = self._future.get_loop()             # <<<<<<<<<<<<<<
 *         if isinstance(result_or_exception, BaseException):
 *             loop.call_soon_threadsafe(
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_future); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_loop, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__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, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_loop = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1354
 *         # objects are generally not thread-safe)
 *         loop = self._future.get_loop()
 *         if isinstance(result_or_exception, BaseException):             # <<<<<<<<<<<<<<
 *             loop.call_soon_threadsafe(
 *                 self._future.set_exception, result_or_exception)
*/
  __pyx_t_5 = __Pyx_PyBaseException_Check(__pyx_v_result_or_exception); 
  if (__pyx_t_5) {

    /* "pyarrow/_flight.pyx":1355
 *         loop = self._future.get_loop()
 *         if isinstance(result_or_exception, BaseException):
 *             loop.call_soon_threadsafe(             # <<<<<<<<<<<<<<
 *                 self._future.set_exception, result_or_exception)
 *         else:
*/
    __pyx_t_3 = __pyx_v_loop;
    __Pyx_INCREF(__pyx_t_3);

    /* "pyarrow/_flight.pyx":1356
 *         if isinstance(result_or_exception, BaseException):
 *             loop.call_soon_threadsafe(
 *                 self._future.set_exception, result_or_exception)             # <<<<<<<<<<<<<<
 *         else:
 *             loop.call_soon_threadsafe(
*/
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_future); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_set_exception); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_v_result_or_exception};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_soon_threadsafe, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":1354
 *         # objects are generally not thread-safe)
 *         loop = self._future.get_loop()
 *         if isinstance(result_or_exception, BaseException):             # <<<<<<<<<<<<<<
 *             loop.call_soon_threadsafe(
 *                 self._future.set_exception, result_or_exception)
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1358
 *                 self._future.set_exception, result_or_exception)
 *         else:
 *             loop.call_soon_threadsafe(             # <<<<<<<<<<<<<<
 *                 self._future.set_result, result_or_exception)
 * 
*/
  /*else*/ {
    __pyx_t_6 = __pyx_v_loop;
    __Pyx_INCREF(__pyx_t_6);

    /* "pyarrow/_flight.pyx":1359
 *         else:
 *             loop.call_soon_threadsafe(
 *                 self._future.set_result, result_or_exception)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_future); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_set_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_2, __pyx_v_result_or_exception};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_soon_threadsafe, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":1350
 *         return self._future
 * 
 *     def wakeup(self, result_or_exception) -> None:             # <<<<<<<<<<<<<<
 *         # Mark the Future done from within its loop (asyncio
 *         # objects are generally not thread-safe)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioCall.wakeup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_loop);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1372
 *         FlightClient _client
 * 
 *     def __init__(self, FlightClient client) -> None:             # <<<<<<<<<<<<<<
 *         self._client = client
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_client = 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_client,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, 1372, __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, 1372, __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, 1372, __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, 1372, __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, 1372, __pyx_L3_error)
    }
    __pyx_v_client = ((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1372, __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("pyarrow._flight.AsyncioFlightClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_client), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, 1, "client", 0))) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient___init__(((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)__pyx_v_self), __pyx_v_client);

  /* 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_7pyarrow_7_flight_19AsyncioFlightClient___init__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_client) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":1373
 * 
 *     def __init__(self, FlightClient client) -> None:
 *         self._client = client             # <<<<<<<<<<<<<<
 * 
 *     async def get_flight_info(
*/
  __Pyx_INCREF((PyObject *)__pyx_v_client);
  __Pyx_GIVEREF((PyObject *)__pyx_v_client);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_client);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_client);
  __pyx_v_self->_client = __pyx_v_client;

  /* "pyarrow/_flight.pyx":1372
 *         FlightClient _client
 * 
 *     def __init__(self, FlightClient client) -> None:             # <<<<<<<<<<<<<<
 *         self._client = client
 * 
*/

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

/* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info, "AsyncioFlightClient.get_flight_info(self, FlightDescriptor descriptor: FlightDescriptor, *, FlightCallOptions options: FlightCallOptions = None)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info = {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info};
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_flight_info (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_descriptor,&__pyx_mstate_global->__pyx_n_u_options,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, 1375, __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, 1375, __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_flight_info", 0) < (0)) __PYX_ERR(0, 1375, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1379
 *         descriptor: FlightDescriptor,
 *         *,
 *         options: FlightCallOptions = None,             # <<<<<<<<<<<<<<
 *     ):
 *         call = AsyncioCall()
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_flight_info", 1, 1, 1, i); __PYX_ERR(0, 1375, __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, 1375, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_flight_info", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1375, __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("pyarrow._flight.AsyncioFlightClient.get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 0, "descriptor", 0))) __PYX_ERR(0, 1377, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1379, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info(((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)__pyx_v_self), __pyx_v_descriptor, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/

  /* 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_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_flight_info", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct__get_flight_info(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1375, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_descriptor = __pyx_v_descriptor;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_descriptor);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_descriptor);
  __pyx_cur_scope->__pyx_v_options = __pyx_v_options;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_options);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_options);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_7_flight_19AsyncioFlightClient_4generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_get_flight_info, __pyx_mstate_global->__pyx_n_u_AsyncioFlightClient_get_flight_i, __pyx_mstate_global->__pyx_n_u_pyarrow__flight); if (unlikely(!gen)) __PYX_ERR(0, 1375, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.AsyncioFlightClient.get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_7_flight_19AsyncioFlightClient_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  __Pyx_PySendResult __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_flight_info", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started coroutine");
    __PYX_ERR(0, 1375, __pyx_L1_error)
  }

  /* "pyarrow/_flight.pyx":1381
 *         options: FlightCallOptions = None,
 *     ):
 *         call = AsyncioCall()             # <<<<<<<<<<<<<<
 *         self._get_flight_info(call, descriptor, options)
 *         return await call.as_awaitable()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AsyncioCall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1381, __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, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__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, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_call = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1382
 *     ):
 *         call = AsyncioCall()
 *         self._get_flight_info(call, descriptor, options)             # <<<<<<<<<<<<<<
 *         return await call.as_awaitable()
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_AsyncioFlightClient *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_get_flight_info(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_call, ((PyObject *)__pyx_cur_scope->__pyx_v_descriptor), ((PyObject *)__pyx_cur_scope->__pyx_v_options)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1383
 *         call = AsyncioCall()
 *         self._get_flight_info(call, descriptor, options)
 *         return await call.as_awaitable()             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_flight_info(self, call, descriptor, options):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_call;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_as_awaitable, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1, &__pyx_r);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_5 == PYGEN_NEXT)) {
    __Pyx_GOTREF(__pyx_r);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1383, __pyx_L1_error)
    __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1);
  } else if (likely(__pyx_t_5 == PYGEN_RETURN)) {
    __Pyx_GOTREF(__pyx_r);
    __pyx_t_1 = __pyx_r; __pyx_r = NULL;
  } else {
    __Pyx_XGOTREF(__pyx_r);
    __PYX_ERR(0, 1383, __pyx_L1_error)
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1385
 *         return await call.as_awaitable()
 * 
 *     cdef _get_flight_info(self, call, descriptor, options):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CFlightCallOptions* c_options = \
*/

static PyObject *__pyx_f_7pyarrow_7_flight_19AsyncioFlightClient__get_flight_info(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, PyObject *__pyx_v_call, PyObject *__pyx_v_descriptor, PyObject *__pyx_v_options) {
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::FlightDescriptor __pyx_v_c_descriptor;
  arrow::Future< arrow::flight::FlightInfo>  __pyx_v_c_future;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
   arrow::flight::FlightDescriptor __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_flight_info", 0);

  /* "pyarrow/_flight.pyx":1388
 *         cdef:
 *             CFlightCallOptions* c_options = \
 *                 FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(__pyx_v_options); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1388, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1390
 *                 FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)             # <<<<<<<<<<<<<<
 *             CFuture[CFlightInfo] c_future
 * 
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(__pyx_v_descriptor); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1390, __pyx_L1_error)
  __pyx_v_c_descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_flight.pyx":1393
 *             CFuture[CFlightInfo] c_future
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_future = self._client.client.get().GetFlightInfoAsync(
 *                 deref(c_options), c_descriptor)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1394
 * 
 *         with nogil:
 *             c_future = self._client.client.get().GetFlightInfoAsync(             # <<<<<<<<<<<<<<
 *                 deref(c_options), c_descriptor)
 * 
*/
        __pyx_v_c_future = __pyx_v_self->_client->client.get()->GetFlightInfoAsync((*__pyx_v_c_options), __pyx_v_c_descriptor);
      }

      /* "pyarrow/_flight.pyx":1393
 *             CFuture[CFlightInfo] c_future
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             c_future = self._client.client.get().GetFlightInfoAsync(
 *                 deref(c_options), c_descriptor)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1397
 *                 deref(c_options), c_descriptor)
 * 
 *         BindFuture(move(c_future), call.wakeup, FlightInfo.wrap)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_call, __pyx_mstate_global->__pyx_n_u_wakeup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  arrow::py::BindFuture< arrow::flight::FlightInfo>(cython_std::move<arrow::Future< arrow::flight::FlightInfo> >(__pyx_v_c_future), __pyx_t_3, __pyx_f_7pyarrow_7_flight_10FlightInfo_wrap);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/_flight.pyx":1385
 *         return await call.as_awaitable()
 * 
 *     cdef _get_flight_info(self, call, descriptor, options):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CFlightCallOptions* c_options = \
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioFlightClient._get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_6__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__, "AsyncioFlightClient.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_6__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_6__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_6__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_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._client,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_self->_client);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->_client);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_client)) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._client,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self._client,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._client is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._client,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._client is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, None), state
*/
  /*else*/ {
    __pyx_t_2 = (((PyObject *)__pyx_v_self->_client) != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._client is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._client is not None
 *     if use_setstate:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AsyncioFlightClie); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_137192776);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_137192776);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_137192776) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._client is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, None), state
 *     else:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AsyncioFlightClient__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AsyncioFlightClie); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_137192776);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_137192776);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_137192776) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioFlightClient.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AsyncioFlightClient__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__, "AsyncioFlightClient.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.AsyncioFlightClient.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)__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_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_AsyncioFlightClient__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_AsyncioFlightClient__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AsyncioFlightClient__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.AsyncioFlightClient.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1438
 *         unique_ptr[CFlightClient] client
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_12FlightClient_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_12FlightClient_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_location = 0;
  PyObject *__pyx_v_tls_root_certs = 0;
  PyObject *__pyx_v_cert_chain = 0;
  PyObject *__pyx_v_private_key = 0;
  PyObject *__pyx_v_override_hostname = 0;
  PyObject *__pyx_v_middleware = 0;
  PyObject *__pyx_v_write_size_limit_bytes = 0;
  PyObject *__pyx_v_disable_server_verification = 0;
  PyObject *__pyx_v_generic_options = 0;
  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("__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_location,&__pyx_mstate_global->__pyx_n_u_tls_root_certs,&__pyx_mstate_global->__pyx_n_u_cert_chain,&__pyx_mstate_global->__pyx_n_u_private_key,&__pyx_mstate_global->__pyx_n_u_override_hostname,&__pyx_mstate_global->__pyx_n_u_middleware,&__pyx_mstate_global->__pyx_n_u_write_size_limit_bytes,&__pyx_mstate_global->__pyx_n_u_disable_server_verification,&__pyx_mstate_global->__pyx_n_u_generic_options,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, 1438, __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, 1438, __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, 1438, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1439
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,
 *                  private_key=None, override_hostname=None, middleware=None,             # <<<<<<<<<<<<<<
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1440
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,             # <<<<<<<<<<<<<<
 *                  disable_server_verification=None, generic_options=None):
 *         if isinstance(location, (bytes, str)):
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1441
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):             # <<<<<<<<<<<<<<
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 1438, __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, 1438, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1438
 *         unique_ptr[CFlightClient] client
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1439
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,
 *                  private_key=None, override_hostname=None, middleware=None,             # <<<<<<<<<<<<<<
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1440
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,             # <<<<<<<<<<<<<<
 *                  disable_server_verification=None, generic_options=None):
 *         if isinstance(location, (bytes, str)):
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1441
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):             # <<<<<<<<<<<<<<
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_location = values[0];
    __pyx_v_tls_root_certs = values[1];
    __pyx_v_cert_chain = values[2];
    __pyx_v_private_key = values[3];
    __pyx_v_override_hostname = values[4];
    __pyx_v_middleware = values[5];
    __pyx_v_write_size_limit_bytes = values[6];
    __pyx_v_disable_server_verification = values[7];
    __pyx_v_generic_options = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1438, __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("pyarrow._flight.FlightClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_location, __pyx_v_tls_root_certs, __pyx_v_cert_chain, __pyx_v_private_key, __pyx_v_override_hostname, __pyx_v_middleware, __pyx_v_write_size_limit_bytes, __pyx_v_disable_server_verification, __pyx_v_generic_options);

  /* "pyarrow/_flight.pyx":1438
 *         unique_ptr[CFlightClient] client
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
*/

  /* 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_7pyarrow_7_flight_12FlightClient___init__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_middleware, PyObject *__pyx_v_write_size_limit_bytes, PyObject *__pyx_v_disable_server_verification, PyObject *__pyx_v_generic_options) {
  PyObject *__pyx_v_host = NULL;
  PyObject *__pyx_v_port = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_location);

  /* "pyarrow/_flight.pyx":1442
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):
 *         if isinstance(location, (bytes, str)):             # <<<<<<<<<<<<<<
 *             location = Location(location)
 *         elif isinstance(location, tuple):
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_location); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_location); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1443
 *                  disable_server_verification=None, generic_options=None):
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)             # <<<<<<<<<<<<<<
 *         elif isinstance(location, tuple):
 *             host, port = location
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_location};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __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;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1443, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_location, ((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":1442
 *                  write_size_limit_bytes=None,
 *                  disable_server_verification=None, generic_options=None):
 *         if isinstance(location, (bytes, str)):             # <<<<<<<<<<<<<<
 *             location = Location(location)
 *         elif isinstance(location, tuple):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1444
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
 *         elif isinstance(location, tuple):             # <<<<<<<<<<<<<<
 *             host, port = location
 *             if tls_root_certs or disable_server_verification is not None:
*/
  __pyx_t_1 = PyTuple_Check(__pyx_v_location); 
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1445
 *             location = Location(location)
 *         elif isinstance(location, tuple):
 *             host, port = location             # <<<<<<<<<<<<<<
 *             if tls_root_certs or disable_server_verification is not None:
 *                 location = Location.for_grpc_tls(host, port)
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_location))) || (PyList_CheckExact(__pyx_v_location))) {
      PyObject* sequence = __pyx_v_location;
      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, 1445, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_location); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1445, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_host = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_port = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":1446
 *         elif isinstance(location, tuple):
 *             host, port = location
 *             if tls_root_certs or disable_server_verification is not None:             # <<<<<<<<<<<<<<
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
*/
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tls_root_certs); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1446, __pyx_L1_error)
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_disable_server_verification != Py_None);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

      /* "pyarrow/_flight.pyx":1447
 *             host, port = location
 *             if tls_root_certs or disable_server_verification is not None:
 *                 location = Location.for_grpc_tls(host, port)             # <<<<<<<<<<<<<<
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
*/
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_host, __pyx_v_port};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_for_grpc_tls, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_location, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":1446
 *         elif isinstance(location, tuple):
 *             host, port = location
 *             if tls_root_certs or disable_server_verification is not None:             # <<<<<<<<<<<<<<
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
*/
      goto __pyx_L8;
    }

    /* "pyarrow/_flight.pyx":1449
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)             # <<<<<<<<<<<<<<
 *         elif not isinstance(location, Location):
 *             raise TypeError('`location` argument must be a string, tuple or a '
*/
    /*else*/ {
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_host, __pyx_v_port};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_for_grpc_tcp, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_location, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L8:;

    /* "pyarrow/_flight.pyx":1444
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
 *         elif isinstance(location, tuple):             # <<<<<<<<<<<<<<
 *             host, port = location
 *             if tls_root_certs or disable_server_verification is not None:
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1450
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":1451
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):
 *             raise TypeError('`location` argument must be a string, tuple or a '             # <<<<<<<<<<<<<<
 *                             'Location instance')
 *         self.init(location, tls_root_certs, cert_chain, private_key,
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_location_argument_must_be_a_str};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __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, 1451, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1450
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
*/
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":1453
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
 *         self.init(location, tls_root_certs, cert_chain, private_key,             # <<<<<<<<<<<<<<
 *                   override_hostname, middleware, write_size_limit_bytes,
 *                   disable_server_verification, generic_options)
*/
  if (!(likely(((__pyx_v_location) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location))))) __PYX_ERR(0, 1453, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":1455
 *         self.init(location, tls_root_certs, cert_chain, private_key,
 *                   override_hostname, middleware, write_size_limit_bytes,
 *                   disable_server_verification, generic_options)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, Location location, tls_root_certs, cert_chain,
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightClient *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_location), __pyx_v_tls_root_certs, __pyx_v_cert_chain, __pyx_v_private_key, __pyx_v_override_hostname, __pyx_v_middleware, __pyx_v_write_size_limit_bytes, __pyx_v_disable_server_verification, __pyx_v_generic_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_flight.pyx":1438
 *         unique_ptr[CFlightClient] client
 * 
 *     def __init__(self, location, *, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                  private_key=None, override_hostname=None, middleware=None,
 *                  write_size_limit_bytes=None,
*/

  /* 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_6);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_host);
  __Pyx_XDECREF(__pyx_v_port);
  __Pyx_XDECREF(__pyx_v_location);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1457
 *                   disable_server_verification, generic_options)
 * 
 *     cdef init(self, Location location, tls_root_certs, cert_chain,             # <<<<<<<<<<<<<<
 *               private_key, override_hostname, middleware,
 *               write_size_limit_bytes, disable_server_verification,
*/

static PyObject *__pyx_f_7pyarrow_7_flight_12FlightClient_init(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_middleware, PyObject *__pyx_v_write_size_limit_bytes, PyObject *__pyx_v_disable_server_verification, PyObject *__pyx_v_generic_options) {
   arrow::flight::Location __pyx_v_c_location;
   arrow::flight::FlightClientOptions __pyx_v_c_options;
  std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_middleware_start_call>  __pyx_v_start_call;
   std::variant<int, std::string> __pyx_v_variant;
  PyObject *__pyx_v_factory = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::Location __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;
  std::string __pyx_t_7;
  bool __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  std::shared_ptr< arrow::py::flight::PyClientMiddlewareFactory>  __pyx_t_11;
  int64_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  int __pyx_t_16;
  int __pyx_t_17;
  std::pair<std::string, std::variant<int, std::string>>  __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_flight.pyx":1462
 *               generic_options):
 *         cdef:
 *             CLocation c_location = Location.unwrap(location)             # <<<<<<<<<<<<<<
 *             CFlightClientOptions c_options = CFlightClientOptions.Defaults()
 *             function[cb_client_middleware_start_call] start_call = \
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_8Location_unwrap(((PyObject *)__pyx_v_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1462, __pyx_L1_error)
  __pyx_v_c_location = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":1463
 *         cdef:
 *             CLocation c_location = Location.unwrap(location)
 *             CFlightClientOptions c_options = CFlightClientOptions.Defaults()             # <<<<<<<<<<<<<<
 *             function[cb_client_middleware_start_call] start_call = \
 *                 &_client_middleware_start_call
*/
  __pyx_v_c_options =  arrow::flight::FlightClientOptions::Defaults();

  /* "pyarrow/_flight.pyx":1465
 *             CFlightClientOptions c_options = CFlightClientOptions.Defaults()
 *             function[cb_client_middleware_start_call] start_call = \
 *                 &_client_middleware_start_call             # <<<<<<<<<<<<<<
 *             CIntStringVariant variant
 * 
*/
  __pyx_v_start_call = (&__pyx_f_7pyarrow_7_flight__client_middleware_start_call);

  /* "pyarrow/_flight.pyx":1468
 *             CIntStringVariant variant
 * 
 *         if tls_root_certs:             # <<<<<<<<<<<<<<
 *             c_options.tls_root_certs = tobytes(tls_root_certs)
 *         if cert_chain:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tls_root_certs); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1468, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1469
 * 
 *         if tls_root_certs:
 *             c_options.tls_root_certs = tobytes(tls_root_certs)             # <<<<<<<<<<<<<<
 *         if cert_chain:
 *             c_options.cert_chain = tobytes(cert_chain)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1469, __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_v_tls_root_certs};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 1469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1469, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.tls_root_certs = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":1468
 *             CIntStringVariant variant
 * 
 *         if tls_root_certs:             # <<<<<<<<<<<<<<
 *             c_options.tls_root_certs = tobytes(tls_root_certs)
 *         if cert_chain:
*/
  }

  /* "pyarrow/_flight.pyx":1470
 *         if tls_root_certs:
 *             c_options.tls_root_certs = tobytes(tls_root_certs)
 *         if cert_chain:             # <<<<<<<<<<<<<<
 *             c_options.cert_chain = tobytes(cert_chain)
 *         if private_key:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_cert_chain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1471
 *             c_options.tls_root_certs = tobytes(tls_root_certs)
 *         if cert_chain:
 *             c_options.cert_chain = tobytes(cert_chain)             # <<<<<<<<<<<<<<
 *         if private_key:
 *             c_options.private_key = tobytes(private_key)
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __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_v_cert_chain};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 1471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1471, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.cert_chain = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":1470
 *         if tls_root_certs:
 *             c_options.tls_root_certs = tobytes(tls_root_certs)
 *         if cert_chain:             # <<<<<<<<<<<<<<
 *             c_options.cert_chain = tobytes(cert_chain)
 *         if private_key:
*/
  }

  /* "pyarrow/_flight.pyx":1472
 *         if cert_chain:
 *             c_options.cert_chain = tobytes(cert_chain)
 *         if private_key:             # <<<<<<<<<<<<<<
 *             c_options.private_key = tobytes(private_key)
 *         if override_hostname:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_private_key); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1472, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1473
 *             c_options.cert_chain = tobytes(cert_chain)
 *         if private_key:
 *             c_options.private_key = tobytes(private_key)             # <<<<<<<<<<<<<<
 *         if override_hostname:
 *             c_options.override_hostname = tobytes(override_hostname)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1473, __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_v_private_key};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 1473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.private_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":1472
 *         if cert_chain:
 *             c_options.cert_chain = tobytes(cert_chain)
 *         if private_key:             # <<<<<<<<<<<<<<
 *             c_options.private_key = tobytes(private_key)
 *         if override_hostname:
*/
  }

  /* "pyarrow/_flight.pyx":1474
 *         if private_key:
 *             c_options.private_key = tobytes(private_key)
 *         if override_hostname:             # <<<<<<<<<<<<<<
 *             c_options.override_hostname = tobytes(override_hostname)
 *         if disable_server_verification is not None:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_override_hostname); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1474, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1475
 *             c_options.private_key = tobytes(private_key)
 *         if override_hostname:
 *             c_options.override_hostname = tobytes(override_hostname)             # <<<<<<<<<<<<<<
 *         if disable_server_verification is not None:
 *             c_options.disable_server_verification = disable_server_verification
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __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_v_override_hostname};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 1475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1475, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_options.override_hostname = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":1474
 *         if private_key:
 *             c_options.private_key = tobytes(private_key)
 *         if override_hostname:             # <<<<<<<<<<<<<<
 *             c_options.override_hostname = tobytes(override_hostname)
 *         if disable_server_verification is not None:
*/
  }

  /* "pyarrow/_flight.pyx":1476
 *         if override_hostname:
 *             c_options.override_hostname = tobytes(override_hostname)
 *         if disable_server_verification is not None:             # <<<<<<<<<<<<<<
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:
*/
  __pyx_t_2 = (__pyx_v_disable_server_verification != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1477
 *             c_options.override_hostname = tobytes(override_hostname)
 *         if disable_server_verification is not None:
 *             c_options.disable_server_verification = disable_server_verification             # <<<<<<<<<<<<<<
 *         if middleware:
 *             for factory in middleware:
*/
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_disable_server_verification); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1477, __pyx_L1_error)
    __pyx_v_c_options.disable_server_verification = __pyx_t_8;

    /* "pyarrow/_flight.pyx":1476
 *         if override_hostname:
 *             c_options.override_hostname = tobytes(override_hostname)
 *         if disable_server_verification is not None:             # <<<<<<<<<<<<<<
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:
*/
  }

  /* "pyarrow/_flight.pyx":1478
 *         if disable_server_verification is not None:
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:             # <<<<<<<<<<<<<<
 *             for factory in middleware:
 *                 c_options.middleware.push_back(
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_middleware); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1478, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1479
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:
 *             for factory in middleware:             # <<<<<<<<<<<<<<
 *                 c_options.middleware.push_back(
 *                     <shared_ptr[CClientMiddlewareFactory]>
*/
    if (likely(PyList_CheckExact(__pyx_v_middleware)) || PyTuple_CheckExact(__pyx_v_middleware)) {
      __pyx_t_3 = __pyx_v_middleware; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_middleware); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1479, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        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(0, 1479, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_9;
        } 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(0, 1479, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1479, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_3);
        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, 1479, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_factory, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":1482
 *                 c_options.middleware.push_back(
 *                     <shared_ptr[CClientMiddlewareFactory]>
 *                     make_shared[CPyClientMiddlewareFactory](             # <<<<<<<<<<<<<<
 *                         <PyObject*> factory, start_call))
 *         if write_size_limit_bytes is not None:
*/
      try {
        __pyx_t_11 = std::make_shared< arrow::py::flight::PyClientMiddlewareFactory>(((PyObject *)__pyx_v_factory), __pyx_v_start_call);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 1482, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":1480
 *         if middleware:
 *             for factory in middleware:
 *                 c_options.middleware.push_back(             # <<<<<<<<<<<<<<
 *                     <shared_ptr[CClientMiddlewareFactory]>
 *                     make_shared[CPyClientMiddlewareFactory](
*/
      try {
        __pyx_v_c_options.middleware.push_back(((std::shared_ptr< arrow::flight::ClientMiddlewareFactory> )__pyx_t_11));
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 1480, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":1479
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:
 *             for factory in middleware:             # <<<<<<<<<<<<<<
 *                 c_options.middleware.push_back(
 *                     <shared_ptr[CClientMiddlewareFactory]>
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":1478
 *         if disable_server_verification is not None:
 *             c_options.disable_server_verification = disable_server_verification
 *         if middleware:             # <<<<<<<<<<<<<<
 *             for factory in middleware:
 *                 c_options.middleware.push_back(
*/
  }

  /* "pyarrow/_flight.pyx":1484
 *                     make_shared[CPyClientMiddlewareFactory](
 *                         <PyObject*> factory, start_call))
 *         if write_size_limit_bytes is not None:             # <<<<<<<<<<<<<<
 *             c_options.write_size_limit_bytes = write_size_limit_bytes
 *         else:
*/
  __pyx_t_2 = (__pyx_v_write_size_limit_bytes != Py_None);
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1485
 *                         <PyObject*> factory, start_call))
 *         if write_size_limit_bytes is not None:
 *             c_options.write_size_limit_bytes = write_size_limit_bytes             # <<<<<<<<<<<<<<
 *         else:
 *             c_options.write_size_limit_bytes = 0
*/
    __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_v_write_size_limit_bytes); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1485, __pyx_L1_error)
    __pyx_v_c_options.write_size_limit_bytes = __pyx_t_12;

    /* "pyarrow/_flight.pyx":1484
 *                     make_shared[CPyClientMiddlewareFactory](
 *                         <PyObject*> factory, start_call))
 *         if write_size_limit_bytes is not None:             # <<<<<<<<<<<<<<
 *             c_options.write_size_limit_bytes = write_size_limit_bytes
 *         else:
*/
    goto __pyx_L12;
  }

  /* "pyarrow/_flight.pyx":1487
 *             c_options.write_size_limit_bytes = write_size_limit_bytes
 *         else:
 *             c_options.write_size_limit_bytes = 0             # <<<<<<<<<<<<<<
 *         if generic_options:
 *             for key, value in generic_options:
*/
  /*else*/ {
    __pyx_v_c_options.write_size_limit_bytes = 0;
  }
  __pyx_L12:;

  /* "pyarrow/_flight.pyx":1488
 *         else:
 *             c_options.write_size_limit_bytes = 0
 *         if generic_options:             # <<<<<<<<<<<<<<
 *             for key, value in generic_options:
 *                 if isinstance(value, (str, bytes)):
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_generic_options); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1488, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1489
 *             c_options.write_size_limit_bytes = 0
 *         if generic_options:
 *             for key, value in generic_options:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (str, bytes)):
 *                     variant = CIntStringVariant(<c_string> tobytes(value))
*/
    if (likely(PyList_CheckExact(__pyx_v_generic_options)) || PyTuple_CheckExact(__pyx_v_generic_options)) {
      __pyx_t_3 = __pyx_v_generic_options; __Pyx_INCREF(__pyx_t_3);
      __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_generic_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1489, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        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(0, 1489, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_9;
        } 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(0, 1489, __pyx_L1_error)
            #endif
            if (__pyx_t_9 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
          #else
          __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
          #endif
          ++__pyx_t_9;
        }
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_3);
        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, 1489, __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, 1489, __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_13 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_13);
        } else {
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1489, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_13);
        }
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1489, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1489, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14);
        index = 0; __pyx_t_5 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1489, __pyx_L1_error)
        __pyx_t_15 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L17_unpacking_done;
        __pyx_L16_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1489, __pyx_L1_error)
        __pyx_L17_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_13);
      __pyx_t_13 = 0;

      /* "pyarrow/_flight.pyx":1490
 *         if generic_options:
 *             for key, value in generic_options:
 *                 if isinstance(value, (str, bytes)):             # <<<<<<<<<<<<<<
 *                     variant = CIntStringVariant(<c_string> tobytes(value))
 *                 else:
*/
      __pyx_t_16 = PyUnicode_Check(__pyx_v_value); 
      if (!__pyx_t_16) {
      } else {
        __pyx_t_2 = __pyx_t_16;
        goto __pyx_L19_bool_binop_done;
      }
      __pyx_t_16 = PyBytes_Check(__pyx_v_value); 
      __pyx_t_2 = __pyx_t_16;
      __pyx_L19_bool_binop_done:;
      if (__pyx_t_2) {

        /* "pyarrow/_flight.pyx":1491
 *             for key, value in generic_options:
 *                 if isinstance(value, (str, bytes)):
 *                     variant = CIntStringVariant(<c_string> tobytes(value))             # <<<<<<<<<<<<<<
 *                 else:
 *                     variant = CIntStringVariant(<int> value)
*/
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1491, __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_13 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_value};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_variant =  std::variant<int, std::string>(((std::string)__pyx_t_7));

        /* "pyarrow/_flight.pyx":1490
 *         if generic_options:
 *             for key, value in generic_options:
 *                 if isinstance(value, (str, bytes)):             # <<<<<<<<<<<<<<
 *                     variant = CIntStringVariant(<c_string> tobytes(value))
 *                 else:
*/
        goto __pyx_L18;
      }

      /* "pyarrow/_flight.pyx":1493
 *                     variant = CIntStringVariant(<c_string> tobytes(value))
 *                 else:
 *                     variant = CIntStringVariant(<int> value)             # <<<<<<<<<<<<<<
 *                 c_options.generic_options.push_back(
 *                     pair[c_string, CIntStringVariant](tobytes(key), variant))
*/
      /*else*/ {
        __pyx_t_17 = __Pyx_PyLong_As_int(__pyx_v_value); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L1_error)
        __pyx_v_variant =  std::variant<int, std::string>(((int)__pyx_t_17));
      }
      __pyx_L18:;

      /* "pyarrow/_flight.pyx":1495
 *                     variant = CIntStringVariant(<int> value)
 *                 c_options.generic_options.push_back(
 *                     pair[c_string, CIntStringVariant](tobytes(key), variant))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_6 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_6 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_key};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __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_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      try {
        __pyx_t_18 = std::pair<std::string, std::variant<int, std::string>> (__pyx_t_7, __pyx_v_variant);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 1495, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":1494
 *                 else:
 *                     variant = CIntStringVariant(<int> value)
 *                 c_options.generic_options.push_back(             # <<<<<<<<<<<<<<
 *                     pair[c_string, CIntStringVariant](tobytes(key), variant))
 * 
*/
      try {
        __pyx_v_c_options.generic_options.push_back(__pyx_t_18);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 1494, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":1489
 *             c_options.write_size_limit_bytes = 0
 *         if generic_options:
 *             for key, value in generic_options:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, (str, bytes)):
 *                     variant = CIntStringVariant(<c_string> tobytes(value))
*/
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":1488
 *         else:
 *             c_options.write_size_limit_bytes = 0
 *         if generic_options:             # <<<<<<<<<<<<<<
 *             for key, value in generic_options:
 *                 if isinstance(value, (str, bytes)):
*/
  }

  /* "pyarrow/_flight.pyx":1497
 *                     pair[c_string, CIntStringVariant](tobytes(key), variant))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(CFlightClient.Connect(c_location, c_options
 *                                                       ).Value(&self.client))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1498
 * 
 *         with nogil:
 *             check_flight_status(CFlightClient.Connect(c_location, c_options             # <<<<<<<<<<<<<<
 *                                                       ).Value(&self.client))
 * 
*/
        __pyx_t_17 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::flight::FlightClient::Connect(__pyx_v_c_location, __pyx_v_c_options).Value((&__pyx_v_self->client))); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1498, __pyx_L23_error)
      }

      /* "pyarrow/_flight.pyx":1497
 *                     pair[c_string, CIntStringVariant](tobytes(key), variant))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(CFlightClient.Connect(c_location, c_options
 *                                                       ).Value(&self.client))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L24;
        }
        __pyx_L23_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L24:;
      }
  }

  /* "pyarrow/_flight.pyx":1457
 *                   disable_server_verification, generic_options)
 * 
 *     cdef init(self, Location location, tls_root_certs, cert_chain,             # <<<<<<<<<<<<<<
 *               private_key, override_hostname, middleware,
 *               write_size_limit_bytes, disable_server_verification,
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_factory);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1501
 *                                                       ).Value(&self.client))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def supports_async(self):
 *         return self.client.get().supports_async()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_14supports_async_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_14supports_async_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_7pyarrow_7_flight_12FlightClient_14supports_async___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_14supports_async___get__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__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);

  /* "pyarrow/_flight.pyx":1503
 *     @property
 *     def supports_async(self):
 *         return self.client.get().supports_async()             # <<<<<<<<<<<<<<
 * 
 *     def as_async(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->client.get()->supports_async()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1501
 *                                                       ).Value(&self.client))
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def supports_async(self):
 *         return self.client.get().supports_async()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.supports_async.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1505
 *         return self.client.get().supports_async()
 * 
 *     def as_async(self) -> None:             # <<<<<<<<<<<<<<
 *         check_status(self.client.get().CheckAsyncSupport())
 *         return AsyncioFlightClient(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_3as_async(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_2as_async, "FlightClient.as_async(self) -> None");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_3as_async = {"as_async", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_3as_async, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_2as_async};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_3as_async(PyObject *__pyx_v_self, 
#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("as_async (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("as_async", 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("as_async", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_2as_async(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_2as_async(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("as_async", 0);

  /* "pyarrow/_flight.pyx":1506
 * 
 *     def as_async(self) -> None:
 *         check_status(self.client.get().CheckAsyncSupport())             # <<<<<<<<<<<<<<
 *         return AsyncioFlightClient(self)
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->CheckAsyncSupport()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1506, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":1507
 *     def as_async(self) -> None:
 *         check_status(self.client.get().CheckAsyncSupport())
 *         return AsyncioFlightClient(self)             # <<<<<<<<<<<<<<
 * 
 *     def wait_for_available(self, timeout=5):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1505
 *         return self.client.get().supports_async()
 * 
 *     def as_async(self) -> None:             # <<<<<<<<<<<<<<
 *         check_status(self.client.get().CheckAsyncSupport())
 *         return AsyncioFlightClient(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.as_async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1509
 *         return AsyncioFlightClient(self)
 * 
 *     def wait_for_available(self, timeout=5):             # <<<<<<<<<<<<<<
 *         """Block until the server can be contacted.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_5wait_for_available(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_4wait_for_available, "FlightClient.wait_for_available(self, timeout=5)\n\nBlock until the server can be contacted.\n\nParameters\n----------\ntimeout : int, default 5\n    The maximum seconds to wait.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_5wait_for_available = {"wait_for_available", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_5wait_for_available, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_4wait_for_available};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_5wait_for_available(PyObject *__pyx_v_self, 
#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_timeout = 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("wait_for_available (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_timeout,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, 1509, __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, 1509, __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, "wait_for_available", 0) < (0)) __PYX_ERR(0, 1509, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_5));
    } 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, 1509, __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_int_5));
    }
    __pyx_v_timeout = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wait_for_available", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1509, __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("pyarrow._flight.FlightClient.wait_for_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_4wait_for_available(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_timeout);

  /* 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_7pyarrow_7_flight_12FlightClient_4wait_for_available(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_timeout) {
  PyObject *__pyx_v_deadline = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait_for_available", 0);

  /* "pyarrow/_flight.pyx":1517
 *             The maximum seconds to wait.
 *         """
 *         deadline = time.time() + timeout             # <<<<<<<<<<<<<<
 *         while True:
 *             try:
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __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((PyObject*)__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, 1517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_v_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_deadline = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/_flight.pyx":1518
 *         """
 *         deadline = time.time() + timeout
 *         while True:             # <<<<<<<<<<<<<<
 *             try:
 *                 list(self.list_flights())
*/
  while (1) {

    /* "pyarrow/_flight.pyx":1519
 *         deadline = time.time() + timeout
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 list(self.list_flights())
 *             except FlightUnavailableError:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1520
 *         while True:
 *             try:
 *                 list(self.list_flights())             # <<<<<<<<<<<<<<
 *             except FlightUnavailableError:
 *                 if time.time() < deadline:
*/
        __pyx_t_1 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_list_flights, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/_flight.pyx":1519
 *         deadline = time.time() + timeout
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 list(self.list_flights())
 *             except FlightUnavailableError:
*/
      }

      /* "pyarrow/_flight.pyx":1532
 *                 break
 *             else:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
      /*else:*/ {
        goto __pyx_L10_try_break;
      }
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":1521
 *             try:
 *                 list(self.list_flights())
 *             except FlightUnavailableError:             # <<<<<<<<<<<<<<
 *                 if time.time() < deadline:
 *                     time.sleep(0.025)
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("pyarrow._flight.FlightClient.wait_for_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 1521, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_2);

        /* "pyarrow/_flight.pyx":1522
 *                 list(self.list_flights())
 *             except FlightUnavailableError:
 *                 if time.time() < deadline:             # <<<<<<<<<<<<<<
 *                     time.sleep(0.025)
 *                     continue
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1522, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1522, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_5 = 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_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L7_except_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_t_12 = PyObject_RichCompare(__pyx_t_3, __pyx_v_deadline, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1522, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1522, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (likely(__pyx_t_13)) {

          /* "pyarrow/_flight.pyx":1523
 *             except FlightUnavailableError:
 *                 if time.time() < deadline:
 *                     time.sleep(0.025)             # <<<<<<<<<<<<<<
 *                     continue
 *                 else:
*/
          __pyx_t_3 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1523, __pyx_L7_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1523, __pyx_L7_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
            assert(__pyx_t_3);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_float_0_025};
            __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __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_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1523, __pyx_L7_except_error)
            __Pyx_GOTREF(__pyx_t_12);
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "pyarrow/_flight.pyx":1524
 *                 if time.time() < deadline:
 *                     time.sleep(0.025)
 *                     continue             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise
*/
          goto __pyx_L13_except_continue;

          /* "pyarrow/_flight.pyx":1522
 *                 list(self.list_flights())
 *             except FlightUnavailableError:
 *                 if time.time() < deadline:             # <<<<<<<<<<<<<<
 *                     time.sleep(0.025)
 *                     continue
*/
        }

        /* "pyarrow/_flight.pyx":1526
 *                     continue
 *                 else:
 *                     raise             # <<<<<<<<<<<<<<
 *             except NotImplementedError:
 *                 # allow if list_flights is not implemented, because
*/
        /*else*/ {
          __Pyx_GIVEREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_2);
          __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_2);
          __pyx_t_1 = 0;  __pyx_t_4 = 0;  __pyx_t_2 = 0; 
          __PYX_ERR(0, 1526, __pyx_L7_except_error)
        }
        __pyx_L13_except_continue:;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L11_try_continue;
      }

      /* "pyarrow/_flight.pyx":1527
 *                 else:
 *                     raise
 *             except NotImplementedError:             # <<<<<<<<<<<<<<
 *                 # allow if list_flights is not implemented, because
 *                 # the server can be contacted nonetheless
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("pyarrow._flight.FlightClient.wait_for_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 1527, __pyx_L7_except_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_1);

        /* "pyarrow/_flight.pyx":1530
 *                 # allow if list_flights is not implemented, because
 *                 # the server can be contacted nonetheless
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 break
*/
        goto __pyx_L17_except_break;
        __pyx_L17_except_break:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L10_try_break;
      }
      goto __pyx_L7_except_error;

      /* "pyarrow/_flight.pyx":1519
 *         deadline = time.time() + timeout
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 list(self.list_flights())
 *             except FlightUnavailableError:
*/
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L10_try_break:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L4_break;
      __pyx_L11_try_continue:;
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      goto __pyx_L3_continue;
    }
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "pyarrow/_flight.pyx":1509
 *         return AsyncioFlightClient(self)
 * 
 *     def wait_for_available(self, timeout=5):             # <<<<<<<<<<<<<<
 *         """Block until the server can be contacted.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.wait_for_available", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_deadline);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1534
 *                 break
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_7connect(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_7pyarrow_7_flight_12FlightClient_6connect, "FlightClient.connect(cls, location, tls_root_certs=None, cert_chain=None, private_key=None, override_hostname=None, disable_server_verification=None)\n\nConnect to a Flight server.\n\n.. deprecated:: 0.15.0\n    Use the ``FlightClient`` constructor or ``pyarrow.flight.connect`` function instead.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_7connect = {"connect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_7connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_6connect};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_7connect(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_location = 0;
  PyObject *__pyx_v_tls_root_certs = 0;
  PyObject *__pyx_v_cert_chain = 0;
  PyObject *__pyx_v_private_key = 0;
  PyObject *__pyx_v_override_hostname = 0;
  PyObject *__pyx_v_disable_server_verification = 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("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);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_location,&__pyx_mstate_global->__pyx_n_u_tls_root_certs,&__pyx_mstate_global->__pyx_n_u_cert_chain,&__pyx_mstate_global->__pyx_n_u_private_key,&__pyx_mstate_global->__pyx_n_u_override_hostname,&__pyx_mstate_global->__pyx_n_u_disable_server_verification,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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, "connect", 0) < (0)) __PYX_ERR(0, 1534, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1535
 * 
 *     @classmethod
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                 private_key=None, override_hostname=None,
 *                 disable_server_verification=None):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1536
 *     @classmethod
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,             # <<<<<<<<<<<<<<
 *                 disable_server_verification=None):
 *         """Connect to a Flight server.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1537
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
 *                 disable_server_verification=None):             # <<<<<<<<<<<<<<
 *         """Connect to a Flight server.
 * 
*/
      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("connect", 0, 1, 6, i); __PYX_ERR(0, 1534, __pyx_L3_error) }
      }
    } 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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, 1534, __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, 1534, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_flight.pyx":1535
 * 
 *     @classmethod
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,             # <<<<<<<<<<<<<<
 *                 private_key=None, override_hostname=None,
 *                 disable_server_verification=None):
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1536
 *     @classmethod
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,             # <<<<<<<<<<<<<<
 *                 disable_server_verification=None):
 *         """Connect to a Flight server.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":1537
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
 *                 disable_server_verification=None):             # <<<<<<<<<<<<<<
 *         """Connect to a Flight server.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_location = values[0];
    __pyx_v_tls_root_certs = values[1];
    __pyx_v_cert_chain = values[2];
    __pyx_v_private_key = values[3];
    __pyx_v_override_hostname = values[4];
    __pyx_v_disable_server_verification = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connect", 0, 1, 6, __pyx_nargs); __PYX_ERR(0, 1534, __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("pyarrow._flight.FlightClient.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_6connect(((PyTypeObject*)__pyx_v_cls), __pyx_v_location, __pyx_v_tls_root_certs, __pyx_v_cert_chain, __pyx_v_private_key, __pyx_v_override_hostname, __pyx_v_disable_server_verification);

  /* "pyarrow/_flight.pyx":1534
 *                 break
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
*/

  /* 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_7pyarrow_7_flight_12FlightClient_6connect(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_location, PyObject *__pyx_v_tls_root_certs, PyObject *__pyx_v_cert_chain, PyObject *__pyx_v_private_key, PyObject *__pyx_v_override_hostname, PyObject *__pyx_v_disable_server_verification) {
  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("connect", 0);

  /* "pyarrow/_flight.pyx":1543
 *             Use the ``FlightClient`` constructor or ``pyarrow.flight.connect`` function instead.
 *         """
 *         warnings.warn("The 'FlightClient.connect' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "FlightClient constructor or pyarrow.flight.connect "
 *                       "function instead")
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __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_mstate_global->__pyx_kp_u_The_FlightClient_connect_method};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1546
 *                       "FlightClient constructor or pyarrow.flight.connect "
 *                       "function instead")
 *         return FlightClient(             # <<<<<<<<<<<<<<
 *             location, tls_root_certs=tls_root_certs,
 *             cert_chain=cert_chain, private_key=private_key,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = NULL;

  /* "pyarrow/_flight.pyx":1550
 *             cert_chain=cert_chain, private_key=private_key,
 *             override_hostname=override_hostname,
 *             disable_server_verification=disable_server_verification             # <<<<<<<<<<<<<<
 *         )
 * 
*/
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 5 : 0)] = {__pyx_t_4, __pyx_v_location};
    __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_tls_root_certs, __pyx_v_tls_root_certs, __pyx_t_2, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1546, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cert_chain, __pyx_v_cert_chain, __pyx_t_2, __pyx_callargs+2, 1) < (0)) __PYX_ERR(0, 1546, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_private_key, __pyx_v_private_key, __pyx_t_2, __pyx_callargs+2, 2) < (0)) __PYX_ERR(0, 1546, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_override_hostname, __pyx_v_override_hostname, __pyx_t_2, __pyx_callargs+2, 3) < (0)) __PYX_ERR(0, 1546, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_disable_server_verification, __pyx_v_disable_server_verification, __pyx_t_2, __pyx_callargs+2, 4) < (0)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1534
 *                 break
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
*/

  /* 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("pyarrow._flight.FlightClient.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1553
 *         )
 * 
 *     def authenticate(self, auth_handler, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Authenticate to the server.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_9authenticate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_8authenticate, "FlightClient.authenticate(self, auth_handler, FlightCallOptions options: FlightCallOptions = None)\n\nAuthenticate to the server.\n\nParameters\n----------\nauth_handler : ClientAuthHandler\n    The authentication mechanism to use.\noptions : FlightCallOptions\n    Options for this call.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_9authenticate = {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_9authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_8authenticate};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_9authenticate(PyObject *__pyx_v_self, 
#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_auth_handler = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("authenticate (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_auth_handler,&__pyx_mstate_global->__pyx_n_u_options,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, 1553, __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, 1553, __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, 1553, __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, "authenticate", 0) < (0)) __PYX_ERR(0, 1553, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("authenticate", 0, 1, 2, i); __PYX_ERR(0, 1553, __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, 1553, __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, 1553, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_auth_handler = values[0];
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("authenticate", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1553, __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("pyarrow._flight.FlightClient.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1553, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_8authenticate(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_auth_handler, __pyx_v_options);

  /* 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_7pyarrow_7_flight_12FlightClient_8authenticate(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_auth_handler, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  std::unique_ptr< arrow::flight::ClientAuthHandler>  __pyx_v_handler;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[3];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
   arrow::py::flight::PyClientAuthHandler *__pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("authenticate", 0);

  /* "pyarrow/_flight.pyx":1565
 *         cdef:
 *             unique_ptr[CClientAuthHandler] handler
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(auth_handler, ClientAuthHandler):
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1567
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         if not isinstance(auth_handler, ClientAuthHandler):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_auth_handler, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler); 
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/_flight.pyx":1568
 * 
 *         if not isinstance(auth_handler, ClientAuthHandler):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())
*/
    __pyx_t_5 = NULL;

    /* "pyarrow/_flight.pyx":1569
 *         if not isinstance(auth_handler, ClientAuthHandler):
 *             raise TypeError(
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")             # <<<<<<<<<<<<<<
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())
 *         with nogil:
*/
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_auth_handler)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_FlightClient_authenticate_takes;
    __pyx_t_7[1] = __pyx_t_6;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u__3;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 58 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __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, 1568, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1567
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         if not isinstance(auth_handler, ClientAuthHandler):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
*/
  }

  /* "pyarrow/_flight.pyx":1570
 *             raise TypeError(
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(
*/
  __pyx_t_10 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthHandler *)((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v_auth_handler)->__pyx_vtab)->to_handler(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v_auth_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L1_error)
  __pyx_v_handler.reset(__pyx_t_10);

  /* "pyarrow/_flight.pyx":1571
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().Authenticate(deref(c_options),
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1572
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self.client.get().Authenticate(deref(c_options),
 *                                                move(handler)))
*/
        __pyx_t_11 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->Authenticate((*__pyx_v_c_options), cython_std::move<std::unique_ptr< arrow::flight::ClientAuthHandler> >(__pyx_v_handler))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1572, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":1571
 *                 f"FlightClient.authenticate takes a ClientAuthHandler, not '{type(auth_handler)}'")
 *         handler.reset((<ClientAuthHandler> auth_handler).to_handler())
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().Authenticate(deref(c_options),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":1553
 *         )
 * 
 *     def authenticate(self, auth_handler, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Authenticate to the server.
 * 
*/

  /* 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_8);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1576
 *                                                move(handler)))
 * 
 *     def authenticate_basic_token(self, username, password,             # <<<<<<<<<<<<<<
 *                                  options: FlightCallOptions = None):
 *         """Authenticate to the server with HTTP basic authentication.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token, "FlightClient.authenticate_basic_token(self, username, password, FlightCallOptions options: FlightCallOptions = None)\n\nAuthenticate to the server with HTTP basic authentication.\n\nParameters\n----------\nusername : string\n    Username to authenticate with\npassword : string\n    Password to authenticate with\noptions  : FlightCallOptions\n    Options for this call\n\nReturns\n-------\ntuple : Tuple[str, str]\n    A tuple representing the FlightCallOptions authorization\n    header entry of a bearer token.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token = {"authenticate_basic_token", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token(PyObject *__pyx_v_self, 
#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_username = 0;
  PyObject *__pyx_v_password = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("authenticate_basic_token (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_username,&__pyx_mstate_global->__pyx_n_u_password,&__pyx_mstate_global->__pyx_n_u_options,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, 1576, __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, 1576, __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, 1576, __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, 1576, __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, "authenticate_basic_token", 0) < (0)) __PYX_ERR(0, 1576, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1577
 * 
 *     def authenticate_basic_token(self, username, password,
 *                                  options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Authenticate to the server with HTTP basic authentication.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("authenticate_basic_token", 0, 2, 3, i); __PYX_ERR(0, 1576, __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, 1576, __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, 1576, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1576, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_username = values[0];
    __pyx_v_password = values[1];
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("authenticate_basic_token", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1576, __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("pyarrow._flight.FlightClient.authenticate_basic_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1577, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_username, __pyx_v_password, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1576
 *                                                move(handler)))
 * 
 *     def authenticate_basic_token(self, username, password,             # <<<<<<<<<<<<<<
 *                                  options: FlightCallOptions = None):
 *         """Authenticate to the server with HTTP basic authentication.
*/

  /* 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_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_username, PyObject *__pyx_v_password, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  arrow::Result<std::pair<std::string,std::string> >  __pyx_v_result;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
  std::string __pyx_v_user;
  std::string __pyx_v_pw;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__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;
  int __pyx_t_7;
  std::pair<std::string,std::string>  __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("authenticate_basic_token", 0);

  /* "pyarrow/_flight.pyx":1597
 *         cdef:
 *             CResult[pair[c_string, c_string]] result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             c_string user = tobytes(username)
 *             c_string pw = tobytes(password)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1597, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1598
 *             CResult[pair[c_string, c_string]] result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             c_string user = tobytes(username)             # <<<<<<<<<<<<<<
 *             c_string pw = tobytes(password)
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __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_v_username};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 1598, __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, 1598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_user = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":1599
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             c_string user = tobytes(username)
 *             c_string pw = tobytes(password)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1599, __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_v_password};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 1599, __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, 1599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pw = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pyarrow/_flight.pyx":1601
 *             c_string pw = tobytes(password)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().AuthenticateBasicToken(deref(c_options),
 *                                                               user, pw)
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1602
 * 
 *         with nogil:
 *             result = self.client.get().AuthenticateBasicToken(deref(c_options),             # <<<<<<<<<<<<<<
 *                                                               user, pw)
 *             check_flight_status(result.status())
*/
        __pyx_v_result = __pyx_v_self->client.get()->AuthenticateBasicToken((*__pyx_v_c_options), __pyx_v_user, __pyx_v_pw);

        /* "pyarrow/_flight.pyx":1604
 *             result = self.client.get().AuthenticateBasicToken(deref(c_options),
 *                                                               user, pw)
 *             check_flight_status(result.status())             # <<<<<<<<<<<<<<
 * 
 *         return GetResultValue(result)
*/
        __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_result.status()); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1604, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1601
 *             c_string pw = tobytes(password)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = self.client.get().AuthenticateBasicToken(deref(c_options),
 *                                                               user, pw)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1606
 *             check_flight_status(result.status())
 * 
 *         return GetResultValue(result)             # <<<<<<<<<<<<<<
 * 
 *     def list_actions(self, options: FlightCallOptions = None):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = arrow::py::GetResultValue<std::pair<std::string,std::string> >(__pyx_v_result); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1606, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_pair_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1576
 *                                                move(handler)))
 * 
 *     def authenticate_basic_token(self, username, password,             # <<<<<<<<<<<<<<
 *                                  options: FlightCallOptions = None):
 *         """Authenticate to the server with HTTP basic authentication.
*/

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

/* "pyarrow/_flight.pyx":1608
 *         return GetResultValue(result)
 * 
 *     def list_actions(self, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """List the actions available on a service."""
 *         cdef:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_13list_actions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_12list_actions, "FlightClient.list_actions(self, FlightCallOptions options: FlightCallOptions = None)\n\nList the actions available on a service.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_13list_actions = {"list_actions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_13list_actions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_12list_actions};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_13list_actions(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("list_actions (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_options,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, 1608, __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, 1608, __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, "list_actions", 0) < (0)) __PYX_ERR(0, 1608, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)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, 1608, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_actions", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1608, __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("pyarrow._flight.FlightClient.list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1608, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_12list_actions(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_options);

  /* 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_7pyarrow_7_flight_12FlightClient_12list_actions(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  std::vector< arrow::flight::ActionType>  __pyx_v_results;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
  PyObject *__pyx_v_stop_handler = NULL;
  PyObject *__pyx_v_result = NULL;
   arrow::flight::ActionType __pyx_v_action_type;
  PyObject *__pyx_v_py_action = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
  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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  arrow::StopToken __pyx_t_11;
  int __pyx_t_12;
  std::vector< arrow::flight::ActionType> ::iterator __pyx_t_13;
   arrow::flight::ActionType __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  int __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_actions", 0);

  /* "pyarrow/_flight.pyx":1612
 *         cdef:
 *             vector[CActionType] results
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 * 
 *         with SignalStopHandler() as stop_handler:
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1612, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1614
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
*/
  /*with:*/ {
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SignalStopHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __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, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 1614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1614, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __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_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1614, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_7 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __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:*/ {
          __pyx_v_stop_handler = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "pyarrow/_flight.pyx":1616
 *         with SignalStopHandler() as stop_handler:
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_flight_status(
*/
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stop_handler, __pyx_mstate_global->__pyx_n_u_stop_token); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1616, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = ((struct __pyx_obj_7pyarrow_3lib_StopToken *)__pyx_t_7)->stop_token;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "pyarrow/_flight.pyx":1615
 * 
 *         with SignalStopHandler() as stop_handler:
 *             c_options.stop_token = \             # <<<<<<<<<<<<<<
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
*/
          __pyx_v_c_options->stop_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

          /* "pyarrow/_flight.pyx":1617
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     self.client.get().ListActions(deref(c_options)).Value(&results))
*/
          {
              PyThreadState * _save;
              _save = PyEval_SaveThread();
              __Pyx_FastGIL_Remember();
              /*try:*/ {

                /* "pyarrow/_flight.pyx":1618
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
 *                 check_flight_status(             # <<<<<<<<<<<<<<
 *                     self.client.get().ListActions(deref(c_options)).Value(&results))
 * 
*/
                __pyx_t_12 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->ListActions((*__pyx_v_c_options)).Value((&__pyx_v_results))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1618, __pyx_L14_error)
              }

              /* "pyarrow/_flight.pyx":1617
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     self.client.get().ListActions(deref(c_options)).Value(&results))
*/
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L15;
                }
                __pyx_L14_error: {
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L7_error;
                }
                __pyx_L15:;
              }
          }

          /* "pyarrow/_flight.pyx":1621
 *                     self.client.get().ListActions(deref(c_options)).Value(&results))
 * 
 *             result = []             # <<<<<<<<<<<<<<
 *             for action_type in results:
 *                 py_action = ActionType(frombytes(action_type.type),
*/
          __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1621, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_v_result = ((PyObject*)__pyx_t_7);
          __pyx_t_7 = 0;

          /* "pyarrow/_flight.pyx":1622
 * 
 *             result = []
 *             for action_type in results:             # <<<<<<<<<<<<<<
 *                 py_action = ActionType(frombytes(action_type.type),
 *                                        frombytes(action_type.description))
*/
          __pyx_t_13 = __pyx_v_results.begin();
          for (; __pyx_t_13 != __pyx_v_results.end(); ++__pyx_t_13) {
            __pyx_t_14 = *__pyx_t_13;
            __pyx_v_action_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

            /* "pyarrow/_flight.pyx":1623
 *             result = []
 *             for action_type in results:
 *                 py_action = ActionType(frombytes(action_type.type),             # <<<<<<<<<<<<<<
 *                                        frombytes(action_type.description))
 *                 result.append(py_action)
*/
            __pyx_t_2 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ActionType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1623, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_15 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1623, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_action_type.type); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1623, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_16))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
              assert(__pyx_t_15);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
              __Pyx_INCREF(__pyx_t_15);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_17};
              __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
            }

            /* "pyarrow/_flight.pyx":1624
 *             for action_type in results:
 *                 py_action = ActionType(frombytes(action_type.type),
 *                                        frombytes(action_type.description))             # <<<<<<<<<<<<<<
 *                 result.append(py_action)
 * 
*/
            __pyx_t_17 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1624, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_18 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_action_type.description); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1624, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_15);
              assert(__pyx_t_17);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
              __Pyx_INCREF(__pyx_t_17);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_18};
              __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1624, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_16);
            }
            __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[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_16};
              __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__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_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1623, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_7);
            }
            __Pyx_XDECREF_SET(__pyx_v_py_action, __pyx_t_7);
            __pyx_t_7 = 0;

            /* "pyarrow/_flight.pyx":1625
 *                 py_action = ActionType(frombytes(action_type.type),
 *                                        frombytes(action_type.description))
 *                 result.append(py_action)             # <<<<<<<<<<<<<<
 * 
 *             return result
*/
            __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_py_action); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(0, 1625, __pyx_L7_error)

            /* "pyarrow/_flight.pyx":1622
 * 
 *             result = []
 *             for action_type in results:             # <<<<<<<<<<<<<<
 *                 py_action = ActionType(frombytes(action_type.type),
 *                                        frombytes(action_type.description))
*/
          }

          /* "pyarrow/_flight.pyx":1627
 *                 result.append(py_action)
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):
*/
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_result);
          __pyx_r = __pyx_v_result;
          goto __pyx_L11_try_return;

          /* "pyarrow/_flight.pyx":1614
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
*/
        }
        __pyx_L7_error:;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 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;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow._flight.FlightClient.list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_4, &__pyx_t_16) < 0) __PYX_ERR(0, 1614, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_16);
          __pyx_t_3 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1614, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_21 = __Pyx_PyObject_IsTrue(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (__pyx_t_21 < (0)) __PYX_ERR(0, 1614, __pyx_L9_except_error)
          __pyx_t_22 = (!__pyx_t_21);
          if (unlikely(__pyx_t_22)) {
            __Pyx_GIVEREF(__pyx_t_7);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_4, __pyx_t_16);
            __pyx_t_7 = 0;  __pyx_t_4 = 0;  __pyx_t_16 = 0; 
            __PYX_ERR(0, 1614, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_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_L11_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_L4_return;
        __pyx_L8_exception_handled:;
        __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);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3], NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_10 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3], NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L22;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L22:;
  }

  /* "pyarrow/_flight.pyx":1608
 *         return GetResultValue(result)
 * 
 *     def list_actions(self, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """List the actions available on a service."""
 *         cdef:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_stop_handler);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_py_action);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1629
 *             return result
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """
 *         Execute an action on a service.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_15do_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_14do_action, "FlightClient.do_action(self, action, FlightCallOptions options: FlightCallOptions = None)\n\nExecute an action on a service.\n\nParameters\n----------\naction : str, tuple, or Action\n    Can be action type name (no body), type and body, or any Action\n    object\noptions : FlightCallOptions\n    RPC options\n\nReturns\n-------\nresults : iterator of Result values");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_15do_action = {"do_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_15do_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_14do_action};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_15do_action(PyObject *__pyx_v_self, 
#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_action = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("do_action (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_action,&__pyx_mstate_global->__pyx_n_u_options,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, 1629, __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, 1629, __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, 1629, __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, "do_action", 0) < (0)) __PYX_ERR(0, 1629, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_action", 0, 1, 2, i); __PYX_ERR(0, 1629, __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, 1629, __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, 1629, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_action = values[0];
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_action", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1629, __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("pyarrow._flight.FlightClient.do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1629, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_14do_action(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_action, __pyx_v_options);

  /* 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_gb_7pyarrow_7_flight_12FlightClient_9do_action_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/_flight.pyx":1662
 *                     deref(c_options), c_action).Value(&results))
 * 
 *         def _do_action_response():             # <<<<<<<<<<<<<<
 *             cdef:
 *                 Result result
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_9do_action_1_do_action_response(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_9do_action_1_do_action_response = {"_do_action_response", (PyCFunction)__pyx_pw_7pyarrow_7_flight_12FlightClient_9do_action_1_do_action_response, METH_NOARGS, 0};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_9do_action_1_do_action_response(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_do_action_response (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_9do_action__do_action_response(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_9do_action__do_action_response(PyObject *__pyx_self) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_action_response", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1662, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_7_flight_12FlightClient_9do_action_2generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_do_action_response, __pyx_mstate_global->__pyx_n_u_do_action_locals__do_action_resp, __pyx_mstate_global->__pyx_n_u_pyarrow__flight); if (unlikely(!gen)) __PYX_ERR(0, 1662, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.do_action._do_action_response", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_7_flight_12FlightClient_9do_action_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_do_action_response", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L12_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 1662, __pyx_L1_error)
  }

  /* "pyarrow/_flight.pyx":1665
 *             cdef:
 *                 Result result
 *             while True:             # <<<<<<<<<<<<<<
 *                 result = Result.__new__(Result)
 *                 with nogil:
*/
  while (1) {

    /* "pyarrow/_flight.pyx":1666
 *                 Result result
 *             while True:
 *                 result = Result.__new__(Result)             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     check_flight_status(results.get().Next().Value(&result.result))
*/
    __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_Result(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1666, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
    __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_result);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, ((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_t_1));
    __Pyx_GIVEREF((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":1667
 *             while True:
 *                 result = Result.__new__(Result)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_flight_status(results.get().Next().Value(&result.result))
 *                     if result.result == nullptr:
*/
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_flight.pyx":1668
 *                 result = Result.__new__(Result)
 *                 with nogil:
 *                     check_flight_status(results.get().Next().Value(&result.result))             # <<<<<<<<<<<<<<
 *                     if result.result == nullptr:
 *                         break
*/
          __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_results.get()->Next().Value((&__pyx_cur_scope->__pyx_v_result->result))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1668, __pyx_L9_error)

          /* "pyarrow/_flight.pyx":1669
 *                 with nogil:
 *                     check_flight_status(results.get().Next().Value(&result.result))
 *                     if result.result == nullptr:             # <<<<<<<<<<<<<<
 *                         break
 *                 yield result
*/
          __pyx_t_3 = ((__pyx_cur_scope->__pyx_v_result->result == nullptr) != 0);
          if (__pyx_t_3) {

            /* "pyarrow/_flight.pyx":1670
 *                     check_flight_status(results.get().Next().Value(&result.result))
 *                     if result.result == nullptr:
 *                         break             # <<<<<<<<<<<<<<
 *                 yield result
 *         return _do_action_response()
*/
            goto __pyx_L7_break;

            /* "pyarrow/_flight.pyx":1669
 *                 with nogil:
 *                     check_flight_status(results.get().Next().Value(&result.result))
 *                     if result.result == nullptr:             # <<<<<<<<<<<<<<
 *                         break
 *                 yield result
*/
          }
        }

        /* "pyarrow/_flight.pyx":1667
 *             while True:
 *                 result = Result.__new__(Result)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_flight_status(results.get().Next().Value(&result.result))
 *                     if result.result == nullptr:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L10;
          }
          __pyx_L7_break: {
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L5_break;
          }
          __pyx_L9_error: {
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
    }

    /* "pyarrow/_flight.pyx":1671
 *                     if result.result == nullptr:
 *                         break
 *                 yield result             # <<<<<<<<<<<<<<
 *         return _do_action_response()
 * 
*/
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_result);
    __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_result);
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L12_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1671, __pyx_L1_error)
  }
  __pyx_L5_break:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/_flight.pyx":1662
 *                     deref(c_options), c_action).Value(&results))
 * 
 *         def _do_action_response():             # <<<<<<<<<<<<<<
 *             cdef:
 *                 Result result
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("_do_action_response", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1629
 *             return result
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """
 *         Execute an action on a service.
*/

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_14do_action(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_action, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *__pyx_cur_scope;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::Action __pyx_v_c_action;
  PyObject *__pyx_v__do_action_response = 0;
  PyObject *__pyx_gb_7pyarrow_7_flight_12FlightClient_9do_action_2generator2 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
   arrow::flight::Action __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_action", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_1_do_action(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1629, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_action);

  /* "pyarrow/_flight.pyx":1647
 *         cdef:
 *             unique_ptr[CResultStream] results
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(action, (str, bytes)):
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1647, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1649
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         if isinstance(action, (str, bytes)):             # <<<<<<<<<<<<<<
 *             action = Action(action, b'')
 *         elif isinstance(action, tuple):
*/
  __pyx_t_3 = PyUnicode_Check(__pyx_v_action); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyBytes_Check(__pyx_v_action); 
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1650
 * 
 *         if isinstance(action, (str, bytes)):
 *             action = Action(action, b'')             # <<<<<<<<<<<<<<
 *         elif isinstance(action, tuple):
 *             action = Action(*action)
*/
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_action, __pyx_mstate_global->__pyx_kp_b__5};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1650, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_action, ((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":1649
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         if isinstance(action, (str, bytes)):             # <<<<<<<<<<<<<<
 *             action = Action(action, b'')
 *         elif isinstance(action, tuple):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1651
 *         if isinstance(action, (str, bytes)):
 *             action = Action(action, b'')
 *         elif isinstance(action, tuple):             # <<<<<<<<<<<<<<
 *             action = Action(*action)
 *         elif not isinstance(action, Action):
*/
  __pyx_t_2 = PyTuple_Check(__pyx_v_action); 
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1652
 *             action = Action(action, b'')
 *         elif isinstance(action, tuple):
 *             action = Action(*action)             # <<<<<<<<<<<<<<
 *         elif not isinstance(action, Action):
 *             raise TypeError("Action must be Action instance, string, or tuple")
*/
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_action); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_action, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":1651
 *         if isinstance(action, (str, bytes)):
 *             action = Action(action, b'')
 *         elif isinstance(action, tuple):             # <<<<<<<<<<<<<<
 *             action = Action(*action)
 *         elif not isinstance(action, Action):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1653
 *         elif isinstance(action, tuple):
 *             action = Action(*action)
 *         elif not isinstance(action, Action):             # <<<<<<<<<<<<<<
 *             raise TypeError("Action must be Action instance, string, or tuple")
 * 
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_action, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action); 
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/_flight.pyx":1654
 *             action = Action(*action)
 *         elif not isinstance(action, Action):
 *             raise TypeError("Action must be Action instance, string, or tuple")             # <<<<<<<<<<<<<<
 * 
 *         cdef CAction c_action = Action.unwrap(<Action> action)
*/
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Action_must_be_Action_instance_s};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1654, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1653
 *         elif isinstance(action, tuple):
 *             action = Action(*action)
 *         elif not isinstance(action, Action):             # <<<<<<<<<<<<<<
 *             raise TypeError("Action must be Action instance, string, or tuple")
 * 
*/
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":1656
 *             raise TypeError("Action must be Action instance, string, or tuple")
 * 
 *         cdef CAction c_action = Action.unwrap(<Action> action)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(
*/
  __pyx_t_7 = __pyx_f_7pyarrow_7_flight_6Action_unwrap(__pyx_v_action); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1656, __pyx_L1_error)
  __pyx_v_c_action = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pyarrow/_flight.pyx":1657
 * 
 *         cdef CAction c_action = Action.unwrap(<Action> action)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().DoAction(
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1658
 *         cdef CAction c_action = Action.unwrap(<Action> action)
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self.client.get().DoAction(
 *                     deref(c_options), c_action).Value(&results))
*/
        __pyx_t_8 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->DoAction((*__pyx_v_c_options), __pyx_v_c_action).Value((&__pyx_cur_scope->__pyx_v_results))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1658, __pyx_L7_error)
      }

      /* "pyarrow/_flight.pyx":1657
 * 
 *         cdef CAction c_action = Action.unwrap(<Action> action)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().DoAction(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pyarrow/_flight.pyx":1662
 *                     deref(c_options), c_action).Value(&results))
 * 
 *         def _do_action_response():             # <<<<<<<<<<<<<<
 *             cdef:
 *                 Result result
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_9do_action_1_do_action_response, 0, __pyx_mstate_global->__pyx_n_u_do_action_locals__do_action_resp, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v__do_action_response = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/_flight.pyx":1672
 *                         break
 *                 yield result
 *         return _do_action_response()             # <<<<<<<<<<<<<<
 * 
 *     def list_flights(self, criteria: bytes = None,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_pf_7pyarrow_7_flight_12FlightClient_9do_action__do_action_response(__pyx_v__do_action_response); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1629
 *             return result
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """
 *         Execute an action on a service.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__do_action_response);
  __Pyx_XDECREF(__pyx_gb_7pyarrow_7_flight_12FlightClient_9do_action_2generator2);
  __Pyx_XDECREF(__pyx_v_action);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7pyarrow_7_flight_12FlightClient_18generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_17list_flights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_16list_flights, "FlightClient.list_flights(self, bytes criteria: bytes = None, FlightCallOptions options: FlightCallOptions = None)\n\nList the flights available on a service.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_17list_flights = {"list_flights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_17list_flights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_16list_flights};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_17list_flights(PyObject *__pyx_v_self, 
#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_criteria = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("list_flights (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_criteria,&__pyx_mstate_global->__pyx_n_u_options,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, 1674, __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, 1674, __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, 1674, __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, "list_flights", 0) < (0)) __PYX_ERR(0, 1674, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "pyarrow/_flight.pyx":1675
 * 
 *     def list_flights(self, criteria: bytes = None,
 *                      options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """List the flights available on a service."""
 *         cdef:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)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, 1674, __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, 1674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)Py_None));

      /* "pyarrow/_flight.pyx":1675
 * 
 *     def list_flights(self, criteria: bytes = None,
 *                      options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """List the flights available on a service."""
 *         cdef:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_criteria = ((PyObject*)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_flights", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1674, __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("pyarrow._flight.FlightClient.list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criteria), (&PyBytes_Type), 1, "criteria", 2))) __PYX_ERR(0, 1674, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1675, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_16list_flights(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_criteria, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/

  /* 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_7pyarrow_7_flight_12FlightClient_16list_flights(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, PyObject *__pyx_v_criteria, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_flights", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_3_list_flights(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1674, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_criteria = __pyx_v_criteria;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_criteria);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_criteria);
  __pyx_cur_scope->__pyx_v_options = __pyx_v_options;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_options);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_options);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7pyarrow_7_flight_12FlightClient_18generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_list_flights, __pyx_mstate_global->__pyx_n_u_FlightClient_list_flights, __pyx_mstate_global->__pyx_n_u_pyarrow__flight); if (unlikely(!gen)) __PYX_ERR(0, 1674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_7pyarrow_7_flight_12FlightClient_18generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
   arrow::flight::FlightCallOptions *__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;
  std::string __pyx_t_7;
  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;
  arrow::StopToken __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_flights", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L26_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(__pyx_sent_value != Py_None)) {
    if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
    __PYX_ERR(0, 1674, __pyx_L1_error)
  }

  /* "pyarrow/_flight.pyx":1680
 *             unique_ptr[CFlightListing] listing
 *             FlightInfo result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CCriteria c_criteria
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_cur_scope->__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1680, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1683
 *             CCriteria c_criteria
 * 
 *         if criteria:             # <<<<<<<<<<<<<<
 *             c_criteria.expression = tobytes(criteria)
 * 
*/
  if (__pyx_cur_scope->__pyx_v_criteria == Py_None) __pyx_t_2 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_criteria);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1683, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1684
 * 
 *         if criteria:
 *             c_criteria.expression = tobytes(criteria)             # <<<<<<<<<<<<<<
 * 
 *         with SignalStopHandler() as stop_handler:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1684, __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_cur_scope->__pyx_v_criteria};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__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, 1684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_cur_scope->__pyx_v_c_criteria.expression = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

    /* "pyarrow/_flight.pyx":1683
 *             CCriteria c_criteria
 * 
 *         if criteria:             # <<<<<<<<<<<<<<
 *             c_criteria.expression = tobytes(criteria)
 * 
*/
  }

  /* "pyarrow/_flight.pyx":1686
 *             c_criteria.expression = tobytes(criteria)
 * 
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
*/
  /*with:*/ {
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SignalStopHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1686, __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, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (1-__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, 1686, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1686, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_9 = __pyx_t_4;
    __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    /*try:*/ {
      {
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        /*try:*/ {
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_cur_scope->__pyx_v_stop_handler = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "pyarrow/_flight.pyx":1688
 *         with SignalStopHandler() as stop_handler:
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_flight_status(
*/
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stop_handler, __pyx_mstate_global->__pyx_n_u_stop_token); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1688, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_13 = ((struct __pyx_obj_7pyarrow_3lib_StopToken *)__pyx_t_9)->stop_token;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "pyarrow/_flight.pyx":1687
 * 
 *         with SignalStopHandler() as stop_handler:
 *             c_options.stop_token = \             # <<<<<<<<<<<<<<
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
*/
          __pyx_cur_scope->__pyx_v_c_options->stop_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_13);

          /* "pyarrow/_flight.pyx":1689
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     self.client.get().ListFlights(deref(c_options),
*/
          {
              PyThreadState * _save;
              _save = PyEval_SaveThread();
              __Pyx_FastGIL_Remember();
              /*try:*/ {

                /* "pyarrow/_flight.pyx":1690
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
 *                 check_flight_status(             # <<<<<<<<<<<<<<
 *                     self.client.get().ListFlights(deref(c_options),
 *                                                   c_criteria).Value(&listing))
*/
                __pyx_t_14 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_cur_scope->__pyx_v_self->client.get()->ListFlights((*__pyx_cur_scope->__pyx_v_c_options), __pyx_cur_scope->__pyx_v_c_criteria).Value((&__pyx_cur_scope->__pyx_v_listing))); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1690, __pyx_L16_error)
              }

              /* "pyarrow/_flight.pyx":1689
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     self.client.get().ListFlights(deref(c_options),
*/
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L17;
                }
                __pyx_L16_error: {
                  __Pyx_FastGIL_Forget();
                  PyEval_RestoreThread(_save);
                  goto __pyx_L9_error;
                }
                __pyx_L17:;
              }
          }

          /* "pyarrow/_flight.pyx":1694
 *                                                   c_criteria).Value(&listing))
 * 
 *             while True:             # <<<<<<<<<<<<<<
 *                 result = FlightInfo.__new__(FlightInfo)
 *                 with nogil:
*/
          while (1) {

            /* "pyarrow/_flight.pyx":1695
 * 
 *             while True:
 *                 result = FlightInfo.__new__(FlightInfo)             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     check_flight_status(listing.get().Next().Value(&result.info))
*/
            __pyx_t_9 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightInfo(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1695, __pyx_L9_error)
            __Pyx_GOTREF((PyObject *)__pyx_t_9);
            __Pyx_XGOTREF((PyObject *)__pyx_cur_scope->__pyx_v_result);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_result, ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_t_9));
            __Pyx_GIVEREF((PyObject *)__pyx_t_9);
            __pyx_t_9 = 0;

            /* "pyarrow/_flight.pyx":1696
 *             while True:
 *                 result = FlightInfo.__new__(FlightInfo)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_flight_status(listing.get().Next().Value(&result.info))
 *                     if result.info == nullptr:
*/
            {
                PyThreadState * _save;
                _save = PyEval_SaveThread();
                __Pyx_FastGIL_Remember();
                /*try:*/ {

                  /* "pyarrow/_flight.pyx":1697
 *                 result = FlightInfo.__new__(FlightInfo)
 *                 with nogil:
 *                     check_flight_status(listing.get().Next().Value(&result.info))             # <<<<<<<<<<<<<<
 *                     if result.info == nullptr:
 *                         break
*/
                  __pyx_t_14 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_cur_scope->__pyx_v_listing.get()->Next().Value((&__pyx_cur_scope->__pyx_v_result->info))); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 1697, __pyx_L23_error)

                  /* "pyarrow/_flight.pyx":1698
 *                 with nogil:
 *                     check_flight_status(listing.get().Next().Value(&result.info))
 *                     if result.info == nullptr:             # <<<<<<<<<<<<<<
 *                         break
 *                 yield result
*/
                  __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_result->info == nullptr) != 0);
                  if (__pyx_t_2) {

                    /* "pyarrow/_flight.pyx":1699
 *                     check_flight_status(listing.get().Next().Value(&result.info))
 *                     if result.info == nullptr:
 *                         break             # <<<<<<<<<<<<<<
 *                 yield result
 * 
*/
                    goto __pyx_L21_break;

                    /* "pyarrow/_flight.pyx":1698
 *                 with nogil:
 *                     check_flight_status(listing.get().Next().Value(&result.info))
 *                     if result.info == nullptr:             # <<<<<<<<<<<<<<
 *                         break
 *                 yield result
*/
                  }
                }

                /* "pyarrow/_flight.pyx":1696
 *             while True:
 *                 result = FlightInfo.__new__(FlightInfo)
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_flight_status(listing.get().Next().Value(&result.info))
 *                     if result.info == nullptr:
*/
                /*finally:*/ {
                  /*normal exit:*/{
                    __Pyx_FastGIL_Forget();
                    PyEval_RestoreThread(_save);
                    goto __pyx_L24;
                  }
                  __pyx_L21_break: {
                    __Pyx_FastGIL_Forget();
                    PyEval_RestoreThread(_save);
                    goto __pyx_L19_break;
                  }
                  __pyx_L23_error: {
                    __Pyx_FastGIL_Forget();
                    PyEval_RestoreThread(_save);
                    goto __pyx_L9_error;
                  }
                  __pyx_L24:;
                }
            }

            /* "pyarrow/_flight.pyx":1700
 *                     if result.info == nullptr:
 *                         break
 *                 yield result             # <<<<<<<<<<<<<<
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,
*/
            __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_result);
            __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_result);
            __Pyx_XGIVEREF(__pyx_t_8);
            __pyx_cur_scope->__pyx_t_0 = __pyx_t_8;
            __Pyx_XGIVEREF(__pyx_t_10);
            __pyx_cur_scope->__pyx_t_1 = __pyx_t_10;
            __Pyx_XGIVEREF(__pyx_t_11);
            __pyx_cur_scope->__pyx_t_2 = __pyx_t_11;
            __Pyx_XGIVEREF(__pyx_t_12);
            __pyx_cur_scope->__pyx_t_3 = __pyx_t_12;
            __Pyx_XGIVEREF(__pyx_r);
            __Pyx_RefNannyFinishContext();
            __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
            /* return from generator, yielding value */
            __pyx_generator->resume_label = 1;
            return __pyx_r;
            __pyx_L26_resume_from_yield:;
            __pyx_t_8 = __pyx_cur_scope->__pyx_t_0;
            __pyx_cur_scope->__pyx_t_0 = 0;
            __Pyx_XGOTREF(__pyx_t_8);
            __pyx_t_10 = __pyx_cur_scope->__pyx_t_1;
            __pyx_cur_scope->__pyx_t_1 = 0;
            __Pyx_XGOTREF(__pyx_t_10);
            __pyx_t_11 = __pyx_cur_scope->__pyx_t_2;
            __pyx_cur_scope->__pyx_t_2 = 0;
            __Pyx_XGOTREF(__pyx_t_11);
            __pyx_t_12 = __pyx_cur_scope->__pyx_t_3;
            __pyx_cur_scope->__pyx_t_3 = 0;
            __Pyx_XGOTREF(__pyx_t_12);
            if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1700, __pyx_L9_error)
          }
          __pyx_L19_break:;

          /* "pyarrow/_flight.pyx":1686
 *             c_criteria.expression = tobytes(criteria)
 * 
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             c_options.stop_token = \
 *                 (<StopToken> stop_handler.stop_token).stop_token
*/
        }
        __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;
        goto __pyx_L14_try_end;
        __pyx_L9_error:;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("pyarrow._flight.FlightClient.list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 1686, __pyx_L11_except_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1686, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1686, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (__pyx_t_2 < (0)) __PYX_ERR(0, 1686, __pyx_L11_except_error)
          __pyx_t_16 = (!__pyx_t_2);
          if (unlikely(__pyx_t_16)) {
            __Pyx_GIVEREF(__pyx_t_9);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_3, __pyx_t_4);
            __pyx_t_9 = 0;  __pyx_t_3 = 0;  __pyx_t_4 = 0; 
            __PYX_ERR(0, 1686, __pyx_L11_except_error)
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L10_exception_handled;
        }
        __pyx_L11_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        goto __pyx_L1_error;
        __pyx_L10_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_8) {
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[3], NULL);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1686, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    goto __pyx_L30;
    __pyx_L5_error:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L1_error;
    __pyx_L30:;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  if (__Pyx_PyErr_Occurred()) {
    __Pyx_Generator_Replace_StopIteration(0);
    __Pyx_AddTraceback("list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1702
 *                 yield result
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                         options: FlightCallOptions = None):
 *         """Request information about an available flight."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_20get_flight_info(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_19get_flight_info, "FlightClient.get_flight_info(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: FlightCallOptions = None)\n\nRequest information about an available flight.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_20get_flight_info = {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_20get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_19get_flight_info};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_20get_flight_info(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_flight_info (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_descriptor,&__pyx_mstate_global->__pyx_n_u_options,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, 1702, __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, 1702, __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, 1702, __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_flight_info", 0) < (0)) __PYX_ERR(0, 1702, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1703
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,
 *                         options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Request information about an available flight."""
 *         cdef:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_flight_info", 0, 1, 2, i); __PYX_ERR(0, 1702, __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, 1702, __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, 1702, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_flight_info", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1702, __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("pyarrow._flight.FlightClient.get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 0, "descriptor", 0))) __PYX_ERR(0, 1702, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1703, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_19get_flight_info(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_descriptor, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1702
 *                 yield result
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                         options: FlightCallOptions = None):
 *         """Request information about an available flight."""
*/

  /* 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_7pyarrow_7_flight_12FlightClient_19get_flight_info(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *__pyx_v_result = 0;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::FlightDescriptor __pyx_v_c_descriptor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
   arrow::flight::FlightCallOptions *__pyx_t_2;
   arrow::flight::FlightDescriptor __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_flight_info", 0);

  /* "pyarrow/_flight.pyx":1706
 *         """Request information about an available flight."""
 *         cdef:
 *             FlightInfo result = FlightInfo.__new__(FlightInfo)             # <<<<<<<<<<<<<<
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightInfo(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1707
 *         cdef:
 *             FlightInfo result = FlightInfo.__new__(FlightInfo)
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_2;

  /* "pyarrow/_flight.pyx":1709
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_3 = __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(((PyObject *)__pyx_v_descriptor)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L1_error)
  __pyx_v_c_descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_flight.pyx":1711
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().GetFlightInfo(
 *                 deref(c_options), c_descriptor).Value(&result.info))
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1712
 * 
 *         with nogil:
 *             check_flight_status(self.client.get().GetFlightInfo(             # <<<<<<<<<<<<<<
 *                 deref(c_options), c_descriptor).Value(&result.info))
 * 
*/
        __pyx_t_4 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->GetFlightInfo((*__pyx_v_c_options), __pyx_v_c_descriptor).Value((&__pyx_v_result->info))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1712, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1711
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().GetFlightInfo(
 *                 deref(c_options), c_descriptor).Value(&result.info))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1715
 *                 deref(c_options), c_descriptor).Value(&result.info))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1702
 *                 yield result
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                         options: FlightCallOptions = None):
 *         """Request information about an available flight."""
*/

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

/* "pyarrow/_flight.pyx":1717
 *         return result
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                    options: FlightCallOptions = None):
 *         """Request schema for an available flight."""
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_22get_schema(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_21get_schema, "FlightClient.get_schema(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: FlightCallOptions = None)\n\nRequest schema for an available flight.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_22get_schema = {"get_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_22get_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_21get_schema};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_22get_schema(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_schema (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_descriptor,&__pyx_mstate_global->__pyx_n_u_options,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, 1717, __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, 1717, __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, 1717, __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_schema", 0) < (0)) __PYX_ERR(0, 1717, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1718
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,
 *                    options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Request schema for an available flight."""
 *         cdef:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_schema", 0, 1, 2, i); __PYX_ERR(0, 1717, __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, 1717, __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, 1717, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_schema", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1717, __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("pyarrow._flight.FlightClient.get_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 0, "descriptor", 0))) __PYX_ERR(0, 1717, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1718, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_21get_schema(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_descriptor, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1717
 *         return result
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                    options: FlightCallOptions = None):
 *         """Request schema for an available flight."""
*/

  /* 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_7pyarrow_7_flight_12FlightClient_21get_schema(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  struct __pyx_obj_7pyarrow_7_flight_SchemaResult *__pyx_v_result = 0;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::FlightDescriptor __pyx_v_c_descriptor;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
   arrow::flight::FlightCallOptions *__pyx_t_2;
   arrow::flight::FlightDescriptor __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_schema", 0);

  /* "pyarrow/_flight.pyx":1721
 *         """Request schema for an available flight."""
 *         cdef:
 *             SchemaResult result = SchemaResult.__new__(SchemaResult)             # <<<<<<<<<<<<<<
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_SchemaResult(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1722
 *         cdef:
 *             SchemaResult result = SchemaResult.__new__(SchemaResult)
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1722, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_2;

  /* "pyarrow/_flight.pyx":1724
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(
*/
  __pyx_t_3 = __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(((PyObject *)__pyx_v_descriptor)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1724, __pyx_L1_error)
  __pyx_v_c_descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_flight.pyx":1725
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.client.get()
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1726
 *                 FlightDescriptor.unwrap(descriptor)
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 self.client.get()
 *                     .GetSchema(deref(c_options), c_descriptor).Value(&result.result)
*/
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->client.get()->GetSchema((*__pyx_v_c_options), __pyx_v_c_descriptor).Value((&__pyx_v_result->result))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1726, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1725
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 self.client.get()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1731
 *             )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def do_get(self, ticket: Ticket, options: FlightCallOptions = None):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1717
 *         return result
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                    options: FlightCallOptions = None):
 *         """Request schema for an available flight."""
*/

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

/* "pyarrow/_flight.pyx":1733
 *         return result
 * 
 *     def do_get(self, ticket: Ticket, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Request the data for a flight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_24do_get(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_23do_get, "FlightClient.do_get(self, Ticket ticket: Ticket, FlightCallOptions options: FlightCallOptions = None)\n\nRequest the data for a flight.\n\nReturns\n-------\nreader : FlightStreamReader");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_24do_get = {"do_get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_24do_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_23do_get};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_24do_get(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_Ticket *__pyx_v_ticket = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("do_get (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_ticket,&__pyx_mstate_global->__pyx_n_u_options,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, 1733, __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, 1733, __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, 1733, __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, "do_get", 0) < (0)) __PYX_ERR(0, 1733, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_get", 0, 1, 2, i); __PYX_ERR(0, 1733, __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, 1733, __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, 1733, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_ticket = ((struct __pyx_obj_7pyarrow_7_flight_Ticket *)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_get", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1733, __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("pyarrow._flight.FlightClient.do_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ticket), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, 0, "ticket", 0))) __PYX_ERR(0, 1733, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1733, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_23do_get(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_ticket, __pyx_v_options);

  /* 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_7pyarrow_7_flight_12FlightClient_23do_get(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_ticket, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  std::unique_ptr< arrow::flight::FlightStreamReader>  __pyx_v_reader;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
  int __pyx_t_2;
  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("do_get", 0);

  /* "pyarrow/_flight.pyx":1742
 *         cdef:
 *             unique_ptr[CFlightStreamReader] reader
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1742, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1744
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().DoGet(
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1745
 * 
 *         with nogil:
 *             check_flight_status(             # <<<<<<<<<<<<<<
 *                 self.client.get().DoGet(
 *                     deref(c_options), ticket.c_ticket).Value(&reader))
*/
        __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->DoGet((*__pyx_v_c_options), __pyx_v_ticket->c_ticket).Value((&__pyx_v_reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1745, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1744
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(
 *                 self.client.get().DoGet(
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1748
 *                 self.client.get().DoGet(
 *                     deref(c_options), ticket.c_ticket).Value(&reader))
 *         result = FlightStreamReader()             # <<<<<<<<<<<<<<
 *         result.reader.reset(reader.release())
 *         return result
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/_flight.pyx":1749
 *                     deref(c_options), ticket.c_ticket).Value(&reader))
 *         result = FlightStreamReader()
 *         result.reader.reset(reader.release())             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->__pyx_base.__pyx_base.reader.reset(__pyx_v_reader.release());

  /* "pyarrow/_flight.pyx":1750
 *         result = FlightStreamReader()
 *         result.reader.reset(reader.release())
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1733
 *         return result
 * 
 *     def do_get(self, ticket: Ticket, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Request the data for a flight.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.do_get", __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;
}

/* "pyarrow/_flight.pyx":1752
 *         return result
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,             # <<<<<<<<<<<<<<
 *                options: FlightCallOptions = None):
 *         """Upload data to a flight.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_26do_put(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_25do_put, "FlightClient.do_put(self, FlightDescriptor descriptor: FlightDescriptor, Schema schema, FlightCallOptions options: FlightCallOptions = None)\n\nUpload data to a flight.\n\nReturns\n-------\nwriter : FlightStreamWriter\nreader : FlightMetadataReader");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_26do_put = {"do_put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_26do_put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_25do_put};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_26do_put(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("do_put (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_descriptor,&__pyx_mstate_global->__pyx_n_u_schema,&__pyx_mstate_global->__pyx_n_u_options,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, 1752, __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, 1752, __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, 1752, __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, 1752, __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, "do_put", 0) < (0)) __PYX_ERR(0, 1752, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1753
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,
 *                options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Upload data to a flight.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_put", 0, 2, 3, i); __PYX_ERR(0, 1752, __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, 1752, __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, 1752, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1752, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[0]);
    __pyx_v_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)values[1]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_put", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1752, __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("pyarrow._flight.FlightClient.do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 0, "descriptor", 0))) __PYX_ERR(0, 1752, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Schema, 0, "schema", 0))) __PYX_ERR(0, 1752, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1753, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_25do_put(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_descriptor, __pyx_v_schema, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1752
 *         return result
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,             # <<<<<<<<<<<<<<
 *                options: FlightCallOptions = None):
 *         """Upload data to a flight.
*/

  /* 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_7pyarrow_7_flight_12FlightClient_25do_put(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
   arrow::flight::FlightClient::DoPutResult __pyx_v_c_do_put_result;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::FlightDescriptor __pyx_v_c_descriptor;
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_py_writer = NULL;
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *__pyx_v_py_reader = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
   arrow::flight::FlightCallOptions *__pyx_t_2;
   arrow::flight::FlightDescriptor __pyx_t_3;
  int __pyx_t_4;
  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("do_put", 0);

  /* "pyarrow/_flight.pyx":1762
 *         """
 *         cdef:
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *             CDoPutResult c_do_put_result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(((PyObject *)__pyx_v_schema)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error)
  __pyx_v_c_schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":1764
 *             shared_ptr[CSchema] c_schema = pyarrow_unwrap_schema(schema)
 *             CDoPutResult c_do_put_result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1764, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_2;

  /* "pyarrow/_flight.pyx":1766
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_3 = __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(((PyObject *)__pyx_v_descriptor)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1766, __pyx_L1_error)
  __pyx_v_c_descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_flight.pyx":1768
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().DoPut(
 *                 deref(c_options),
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1769
 * 
 *         with nogil:
 *             check_flight_status(self.client.get().DoPut(             # <<<<<<<<<<<<<<
 *                 deref(c_options),
 *                 c_descriptor,
*/
        __pyx_t_4 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->DoPut((*__pyx_v_c_options), __pyx_v_c_descriptor, __pyx_v_c_schema).Value((&__pyx_v_c_do_put_result))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1769, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1768
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().DoPut(
 *                 deref(c_options),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1773
 *                 c_descriptor,
 *                 c_schema).Value(&c_do_put_result))
 *         py_writer = FlightStreamWriter()             # <<<<<<<<<<<<<<
 *         py_writer.writer.reset(c_do_put_result.writer.release())
 *         py_reader = FlightMetadataReader()
*/
  __pyx_t_6 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1773, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_py_writer = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/_flight.pyx":1774
 *                 c_schema).Value(&c_do_put_result))
 *         py_writer = FlightStreamWriter()
 *         py_writer.writer.reset(c_do_put_result.writer.release())             # <<<<<<<<<<<<<<
 *         py_reader = FlightMetadataReader()
 *         py_reader.reader.reset(c_do_put_result.reader.release())
*/
  __pyx_v_py_writer->__pyx_base.__pyx_base.writer.reset(__pyx_v_c_do_put_result.writer.release());

  /* "pyarrow/_flight.pyx":1775
 *         py_writer = FlightStreamWriter()
 *         py_writer.writer.reset(c_do_put_result.writer.release())
 *         py_reader = FlightMetadataReader()             # <<<<<<<<<<<<<<
 *         py_reader.reader.reset(c_do_put_result.reader.release())
 *         return py_writer, py_reader
*/
  __pyx_t_6 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1775, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_py_reader = ((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/_flight.pyx":1776
 *         py_writer.writer.reset(c_do_put_result.writer.release())
 *         py_reader = FlightMetadataReader()
 *         py_reader.reader.reset(c_do_put_result.reader.release())             # <<<<<<<<<<<<<<
 *         return py_writer, py_reader
 * 
*/
  __pyx_v_py_reader->reader.reset(__pyx_v_c_do_put_result.reader.release());

  /* "pyarrow/_flight.pyx":1777
 *         py_reader = FlightMetadataReader()
 *         py_reader.reader.reset(c_do_put_result.reader.release())
 *         return py_writer, py_reader             # <<<<<<<<<<<<<<
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF((PyObject *)__pyx_v_py_writer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_py_writer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_py_writer)) != (0)) __PYX_ERR(0, 1777, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_py_reader);
  __Pyx_GIVEREF((PyObject *)__pyx_v_py_reader);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_py_reader)) != (0)) __PYX_ERR(0, 1777, __pyx_L1_error);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1752
 *         return result
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,             # <<<<<<<<<<<<<<
 *                options: FlightCallOptions = None):
 *         """Upload data to a flight.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_writer);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_reader);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1779
 *         return py_writer, py_reader
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                     options: FlightCallOptions = None):
 *         """Start a bidirectional data exchange with a server.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_28do_exchange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_27do_exchange, "FlightClient.do_exchange(self, FlightDescriptor descriptor: FlightDescriptor, FlightCallOptions options: FlightCallOptions = None)\n\nStart a bidirectional data exchange with a server.\n\nParameters\n----------\ndescriptor : FlightDescriptor\n    A descriptor for the flight.\noptions : FlightCallOptions\n    RPC options.\n\nReturns\n-------\nwriter : FlightStreamWriter\nreader : FlightStreamReader");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_28do_exchange = {"do_exchange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_28do_exchange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_27do_exchange};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_28do_exchange(PyObject *__pyx_v_self, 
#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_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options = 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("do_exchange (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_descriptor,&__pyx_mstate_global->__pyx_n_u_options,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, 1779, __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, 1779, __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, 1779, __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, "do_exchange", 0) < (0)) __PYX_ERR(0, 1779, __pyx_L3_error)

      /* "pyarrow/_flight.pyx":1780
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,
 *                     options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Start a bidirectional data exchange with a server.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_exchange", 0, 1, 2, i); __PYX_ERR(0, 1779, __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, 1779, __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, 1779, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)Py_None));
    }
    __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)values[0]);
    __pyx_v_options = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_exchange", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1779, __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("pyarrow._flight.FlightClient.do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_descriptor), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, 0, "descriptor", 0))) __PYX_ERR(0, 1779, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_options), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, 1, "options", 0))) __PYX_ERR(0, 1780, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_27do_exchange(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_descriptor, __pyx_v_options);

  /* "pyarrow/_flight.pyx":1779
 *         return py_writer, py_reader
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                     options: FlightCallOptions = None):
 *         """Start a bidirectional data exchange with a server.
*/

  /* 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_7pyarrow_7_flight_12FlightClient_27do_exchange(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor, struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *__pyx_v_options) {
   arrow::flight::FlightClient::DoExchangeResult __pyx_v_c_do_exchange_result;
   arrow::flight::FlightCallOptions *__pyx_v_c_options;
   arrow::flight::FlightDescriptor __pyx_v_c_descriptor;
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *__pyx_v_py_writer = NULL;
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *__pyx_v_py_reader = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::FlightCallOptions *__pyx_t_1;
   arrow::flight::FlightDescriptor __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("do_exchange", 0);

  /* "pyarrow/_flight.pyx":1797
 *         cdef:
 *             CDoExchangeResult c_do_exchange_result
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)             # <<<<<<<<<<<<<<
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap(((PyObject *)__pyx_v_options)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1797, __pyx_L1_error)
  __pyx_v_c_options = __pyx_t_1;

  /* "pyarrow/_flight.pyx":1799
 *             CFlightCallOptions* c_options = FlightCallOptions.unwrap(options)
 *             CFlightDescriptor c_descriptor = \
 *                 FlightDescriptor.unwrap(descriptor)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
*/
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap(((PyObject *)__pyx_v_descriptor)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1799, __pyx_L1_error)
  __pyx_v_c_descriptor = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_flight.pyx":1801
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().DoExchange(
 *                 deref(c_options),
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":1802
 * 
 *         with nogil:
 *             check_flight_status(self.client.get().DoExchange(             # <<<<<<<<<<<<<<
 *                 deref(c_options),
 *                 c_descriptor).Value(&c_do_exchange_result))
*/
        __pyx_t_3 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->client.get()->DoExchange((*__pyx_v_c_options), __pyx_v_c_descriptor).Value((&__pyx_v_c_do_exchange_result))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1802, __pyx_L4_error)
      }

      /* "pyarrow/_flight.pyx":1801
 *                 FlightDescriptor.unwrap(descriptor)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.client.get().DoExchange(
 *                 deref(c_options),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":1805
 *                 deref(c_options),
 *                 c_descriptor).Value(&c_do_exchange_result))
 *         py_writer = FlightStreamWriter()             # <<<<<<<<<<<<<<
 *         py_writer.writer.reset(c_do_exchange_result.writer.release())
 *         py_reader = FlightStreamReader()
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_py_writer = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/_flight.pyx":1806
 *                 c_descriptor).Value(&c_do_exchange_result))
 *         py_writer = FlightStreamWriter()
 *         py_writer.writer.reset(c_do_exchange_result.writer.release())             # <<<<<<<<<<<<<<
 *         py_reader = FlightStreamReader()
 *         py_reader.reader.reset(c_do_exchange_result.reader.release())
*/
  __pyx_v_py_writer->__pyx_base.__pyx_base.writer.reset(__pyx_v_c_do_exchange_result.writer.release());

  /* "pyarrow/_flight.pyx":1807
 *         py_writer = FlightStreamWriter()
 *         py_writer.writer.reset(c_do_exchange_result.writer.release())
 *         py_reader = FlightStreamReader()             # <<<<<<<<<<<<<<
 *         py_reader.reader.reset(c_do_exchange_result.reader.release())
 *         return py_writer, py_reader
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1807, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_py_reader = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/_flight.pyx":1808
 *         py_writer.writer.reset(c_do_exchange_result.writer.release())
 *         py_reader = FlightStreamReader()
 *         py_reader.reader.reset(c_do_exchange_result.reader.release())             # <<<<<<<<<<<<<<
 *         return py_writer, py_reader
 * 
*/
  __pyx_v_py_reader->__pyx_base.__pyx_base.reader.reset(__pyx_v_c_do_exchange_result.reader.release());

  /* "pyarrow/_flight.pyx":1809
 *         py_reader = FlightStreamReader()
 *         py_reader.reader.reset(c_do_exchange_result.reader.release())
 *         return py_writer, py_reader             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF((PyObject *)__pyx_v_py_writer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_py_writer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_py_writer)) != (0)) __PYX_ERR(0, 1809, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_py_reader);
  __Pyx_GIVEREF((PyObject *)__pyx_v_py_reader);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_py_reader)) != (0)) __PYX_ERR(0, 1809, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1779
 *         return py_writer, py_reader
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                     options: FlightCallOptions = None):
 *         """Start a bidirectional data exchange with a server.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_writer);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_reader);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1811
 *         return py_writer, py_reader
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the client and disconnect."""
 *         client = self.client.get()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_30close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_29close, "FlightClient.close(self)\n\nClose the client and disconnect.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_30close = {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_30close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_29close};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_30close(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("close", 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("close", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_29close(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_29close(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self) {
   arrow::flight::FlightClient *__pyx_v_client;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/_flight.pyx":1813
 *     def close(self):
 *         """Close the client and disconnect."""
 *         client = self.client.get()             # <<<<<<<<<<<<<<
 *         if client != NULL:
 *             check_flight_status(client.Close())
*/
  __pyx_v_client = __pyx_v_self->client.get();

  /* "pyarrow/_flight.pyx":1814
 *         """Close the client and disconnect."""
 *         client = self.client.get()
 *         if client != NULL:             # <<<<<<<<<<<<<<
 *             check_flight_status(client.Close())
 * 
*/
  __pyx_t_1 = (__pyx_v_client != NULL);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1815
 *         client = self.client.get()
 *         if client != NULL:
 *             check_flight_status(client.Close())             # <<<<<<<<<<<<<<
 * 
 *     def __del__(self):
*/
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_client->Close()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1815, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1814
 *         """Close the client and disconnect."""
 *         client = self.client.get()
 *         if client != NULL:             # <<<<<<<<<<<<<<
 *             check_flight_status(client.Close())
 * 
*/
  }

  /* "pyarrow/_flight.pyx":1811
 *         return py_writer, py_reader
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the client and disconnect."""
 *         client = self.client.get()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1817
 *             check_flight_status(client.Close())
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         # Not ideal, but close() wasn't originally present so
 *         # applications may not be calling it
*/

/* Python wrapper */
static void __pyx_pw_7pyarrow_7_flight_12FlightClient_32__del__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_7_flight_12FlightClient_32__del__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_pf_7pyarrow_7_flight_12FlightClient_31__del__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static void __pyx_pf_7pyarrow_7_flight_12FlightClient_31__del__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__del__", 0);

  /* "pyarrow/_flight.pyx":1820
 *         # Not ideal, but close() wasn't originally present so
 *         # applications may not be calling it
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1817
 *             check_flight_status(client.Close())
 * 
 *     def __del__(self):             # <<<<<<<<<<<<<<
 *         # Not ideal, but close() wasn't originally present so
 *         # applications may not be calling it
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyarrow._flight.FlightClient.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/_flight.pyx":1822
 *         self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_34__enter__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_33__enter__, "FlightClient.__enter__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_34__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_34__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_33__enter__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_34__enter__(PyObject *__pyx_v_self, 
#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("__enter__ (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("__enter__", 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("__enter__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_33__enter__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_33__enter__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/_flight.pyx":1823
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1822
 *         self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "pyarrow/_flight.pyx":1825
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_36__exit__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_35__exit__, "FlightClient.__exit__(self, exc_type, exc_value, traceback)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_36__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_36__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_35__exit__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_36__exit__(PyObject *__pyx_v_self, 
#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_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 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("__exit__ (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_exc_type,&__pyx_mstate_global->__pyx_n_u_exc_value,&__pyx_mstate_global->__pyx_n_u_traceback,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, 1825, __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, 1825, __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, 1825, __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, 1825, __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, "__exit__", 0) < (0)) __PYX_ERR(0, 1825, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, i); __PYX_ERR(0, 1825, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 1825, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1825, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1825, __pyx_L3_error)
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1825, __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("pyarrow._flight.FlightClient.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_35__exit__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback);

  /* 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_7pyarrow_7_flight_12FlightClient_35__exit__(struct __pyx_obj_7pyarrow_7_flight_FlightClient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/_flight.pyx":1826
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1825
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.__exit__", __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.client cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_38__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_37__reduce_cython__, "FlightClient.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_38__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_38__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_37__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_38__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_7pyarrow_7_flight_12FlightClient_37__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_12FlightClient_37__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightClient *__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.client cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.client cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_client_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightClient.__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.client cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.client cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_40__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_12FlightClient_39__setstate_cython__, "FlightClient.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_12FlightClient_40__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_40__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_39__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_12FlightClient_40__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("pyarrow._flight.FlightClient.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12FlightClient_39__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__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_7pyarrow_7_flight_12FlightClient_39__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightClient *__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.client cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.client cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_client_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1839
 *     """
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         """Create the C++ data stream for the backing Python object.
 * 
*/

static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_16FlightDataStream_to_stream(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self) {
   arrow::flight::FlightDataStream *__pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pyarrow/_flight.pyx":1845
 *         lifetime from the Cython/C++ side.
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 1845, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":1839
 *     """
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         """Create the C++ data stream for the backing Python object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightDataStream.to_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDataStream_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDataStream___reduce_cython__, "FlightDataStream.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDataStream_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDataStream_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDataStream___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDataStream_1__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_7pyarrow_7_flight_16FlightDataStream___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightDataStream___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightDataStream); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightDataStream__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightDataStream); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.FlightDataStream.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightDataStream__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__, "FlightDataStream.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.FlightDataStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__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_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_FlightDataStream__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightDataStream__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightDataStream__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.FlightDataStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1859
 *         CIpcWriteOptions write_options
 * 
 *     def __init__(self, data_source, options=None):             # <<<<<<<<<<<<<<
 *         """Create a RecordBatchStream from a data source.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_17RecordBatchStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17RecordBatchStream___init__, "Create a RecordBatchStream from a data source.\n\n        Parameters\n        ----------\n        data_source : RecordBatchReader or Table\n            The data to stream to the client.\n        options : pyarrow.ipc.IpcWriteOptions, optional\n            Optional IPC options to control how to write the data.\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_17RecordBatchStream___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_17RecordBatchStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data_source = 0;
  PyObject *__pyx_v_options = 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_data_source,&__pyx_mstate_global->__pyx_n_u_options,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, 1859, __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, 1859, __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, 1859, __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, 1859, __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("__init__", 0, 1, 2, i); __PYX_ERR(0, 1859, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1859, __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, 1859, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_data_source = values[0];
    __pyx_v_options = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1859, __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("pyarrow._flight.RecordBatchStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17RecordBatchStream___init__(((struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)__pyx_v_self), __pyx_v_data_source, __pyx_v_options);

  /* 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_7pyarrow_7_flight_17RecordBatchStream___init__(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self, PyObject *__pyx_v_data_source, PyObject *__pyx_v_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
   arrow::ipc::IpcWriteOptions __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":1869
 *             Optional IPC options to control how to write the data.
 *         """
 *         if (not isinstance(data_source, RecordBatchReader) and             # <<<<<<<<<<<<<<
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_data_source, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader); 
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "pyarrow/_flight.pyx":1870
 *         """
 *         if (not isinstance(data_source, RecordBatchReader) and
 *                 not isinstance(data_source, lib.Table)):             # <<<<<<<<<<<<<<
 *             raise TypeError("Expected RecordBatchReader or Table, "
 *                             f"but got: {type(data_source)}")
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Table); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_data_source, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "pyarrow/_flight.pyx":1869
 *             Optional IPC options to control how to write the data.
 *         """
 *         if (not isinstance(data_source, RecordBatchReader) and             # <<<<<<<<<<<<<<
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "
*/
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":1871
 *         if (not isinstance(data_source, RecordBatchReader) and
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "             # <<<<<<<<<<<<<<
 *                             f"but got: {type(data_source)}")
 *         self.data_source = data_source
*/
    __pyx_t_4 = NULL;

    /* "pyarrow/_flight.pyx":1872
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "
 *                             f"but got: {type(data_source)}")             # <<<<<<<<<<<<<<
 *         self.data_source = data_source
 *         self.write_options = _get_options(options).c_options
*/
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_data_source)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "pyarrow/_flight.pyx":1871
 *         if (not isinstance(data_source, RecordBatchReader) and
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "             # <<<<<<<<<<<<<<
 *                             f"but got: {type(data_source)}")
 *         self.data_source = data_source
*/
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Expected_RecordBatchReader_or_Ta, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1871, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1869
 *             Optional IPC options to control how to write the data.
 *         """
 *         if (not isinstance(data_source, RecordBatchReader) and             # <<<<<<<<<<<<<<
 *                 not isinstance(data_source, lib.Table)):
 *             raise TypeError("Expected RecordBatchReader or Table, "
*/
  }

  /* "pyarrow/_flight.pyx":1873
 *             raise TypeError("Expected RecordBatchReader or Table, "
 *                             f"but got: {type(data_source)}")
 *         self.data_source = data_source             # <<<<<<<<<<<<<<
 *         self.write_options = _get_options(options).c_options
 * 
*/
  __Pyx_INCREF(__pyx_v_data_source);
  __Pyx_GIVEREF(__pyx_v_data_source);
  __Pyx_GOTREF(__pyx_v_self->data_source);
  __Pyx_DECREF(__pyx_v_self->data_source);
  __pyx_v_self->data_source = __pyx_v_data_source;

  /* "pyarrow/_flight.pyx":1874
 *                             f"but got: {type(data_source)}")
 *         self.data_source = data_source
 *         self.write_options = _get_options(options).c_options             # <<<<<<<<<<<<<<
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:
*/
  __pyx_t_5 = ((PyObject *)__pyx_f_7pyarrow_7_flight__get_options(__pyx_v_options)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_5)->c_options;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->write_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pyarrow/_flight.pyx":1859
 *         CIpcWriteOptions write_options
 * 
 *     def __init__(self, data_source, options=None):             # <<<<<<<<<<<<<<
 *         """Create a RecordBatchStream from a data source.
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  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_AddTraceback("pyarrow._flight.RecordBatchStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1876
 *         self.write_options = _get_options(options).c_options
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CRecordBatchReader] reader
*/

static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_17RecordBatchStream_to_stream(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__pyx_v_self) {
  std::shared_ptr< arrow::RecordBatchReader>  __pyx_v_reader;
   arrow::Table *__pyx_v_table;
   arrow::flight::FlightDataStream *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  arrow::py::SharedPtrNoGIL< arrow::RecordBatchReader>  __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
   arrow::Table *__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("to_stream", 0);

  /* "pyarrow/_flight.pyx":1879
 *         cdef:
 *             shared_ptr[CRecordBatchReader] reader
 *         if isinstance(self.data_source, RecordBatchReader):             # <<<<<<<<<<<<<<
 *             reader = (<RecordBatchReader> self.data_source).reader
 *         elif isinstance(self.data_source, lib.Table):
*/
  __pyx_t_1 = __pyx_v_self->data_source;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/_flight.pyx":1880
 *             shared_ptr[CRecordBatchReader] reader
 *         if isinstance(self.data_source, RecordBatchReader):
 *             reader = (<RecordBatchReader> self.data_source).reader             # <<<<<<<<<<<<<<
 *         elif isinstance(self.data_source, lib.Table):
 *             table = (<Table> self.data_source).table
*/
    __pyx_t_3 = ((struct __pyx_obj_7pyarrow_3lib_RecordBatchReader *)__pyx_v_self->data_source)->reader;
    __pyx_v_reader = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

    /* "pyarrow/_flight.pyx":1879
 *         cdef:
 *             shared_ptr[CRecordBatchReader] reader
 *         if isinstance(self.data_source, RecordBatchReader):             # <<<<<<<<<<<<<<
 *             reader = (<RecordBatchReader> self.data_source).reader
 *         elif isinstance(self.data_source, lib.Table):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1881
 *         if isinstance(self.data_source, RecordBatchReader):
 *             reader = (<RecordBatchReader> self.data_source).reader
 *         elif isinstance(self.data_source, lib.Table):             # <<<<<<<<<<<<<<
 *             table = (<Table> self.data_source).table
 *             reader.reset(new TableBatchReader(deref(table)))
*/
  __pyx_t_1 = __pyx_v_self->data_source;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Table); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_5); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":1882
 *             reader = (<RecordBatchReader> self.data_source).reader
 *         elif isinstance(self.data_source, lib.Table):
 *             table = (<Table> self.data_source).table             # <<<<<<<<<<<<<<
 *             reader.reset(new TableBatchReader(deref(table)))
 *         else:
*/
    __pyx_t_6 = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self->data_source)->table;
    __pyx_v_table = __pyx_t_6;

    /* "pyarrow/_flight.pyx":1883
 *         elif isinstance(self.data_source, lib.Table):
 *             table = (<Table> self.data_source).table
 *             reader.reset(new TableBatchReader(deref(table)))             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError(
*/
    __pyx_v_reader.reset(new arrow::TableBatchReader((*__pyx_v_table)));

    /* "pyarrow/_flight.pyx":1881
 *         if isinstance(self.data_source, RecordBatchReader):
 *             reader = (<RecordBatchReader> self.data_source).reader
 *         elif isinstance(self.data_source, lib.Table):             # <<<<<<<<<<<<<<
 *             table = (<Table> self.data_source).table
 *             reader.reset(new TableBatchReader(deref(table)))
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":1885
 *             reader.reset(new TableBatchReader(deref(table)))
 *         else:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f"Can't construct RecordBatchStream from type {type(self.data_source)}")
 *         return new CRecordBatchStream(reader, self.write_options)
*/
  /*else*/ {
    __pyx_t_1 = NULL;

    /* "pyarrow/_flight.pyx":1886
 *         else:
 *             raise RuntimeError(
 *                 f"Can't construct RecordBatchStream from type {type(self.data_source)}")             # <<<<<<<<<<<<<<
 *         return new CRecordBatchStream(reader, self.write_options)
 * 
*/
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_self->data_source)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Can_t_construct_RecordBatchStrea, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 1885, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":1887
 *             raise RuntimeError(
 *                 f"Can't construct RecordBatchStream from type {type(self.data_source)}")
 *         return new CRecordBatchStream(reader, self.write_options)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = new  arrow::flight::RecordBatchStream(__pyx_v_reader, __pyx_v_self->write_options);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1876
 *         self.write_options = _get_options(options).c_options
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CRecordBatchReader] reader
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._flight.RecordBatchStream.to_stream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__, "RecordBatchStream.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__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.write_options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.write_options cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_write_options_cannot_be_con, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.RecordBatchStream.__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.write_options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.write_options cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__, "RecordBatchStream.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.RecordBatchStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)__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_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *__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.write_options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.write_options cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_write_options_cannot_be_con, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1900
 *         CIpcWriteOptions c_options
 * 
 *     def __init__(self, schema, generator, options=None):             # <<<<<<<<<<<<<<
 *         """Create a GeneratorStream from a Python generator.
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_15GeneratorStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_15GeneratorStream___init__, "Create a GeneratorStream from a Python generator.\n\n        Parameters\n        ----------\n        schema : Schema\n            The schema for the data to be returned.\n\n        generator : iterator or iterable\n            The generator should yield other FlightDataStream objects,\n            Tables, RecordBatches, or RecordBatchReaders.\n\n        options : pyarrow.ipc.IpcWriteOptions, optional\n        ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7pyarrow_7_flight_15GeneratorStream___init__;
#endif
static int __pyx_pw_7pyarrow_7_flight_15GeneratorStream_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_generator = 0;
  PyObject *__pyx_v_options = 0;
  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_schema,&__pyx_mstate_global->__pyx_n_u_generator,&__pyx_mstate_global->__pyx_n_u_options,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, 1900, __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, 1900, __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, 1900, __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, 1900, __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, 1900, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 1900, __pyx_L3_error) }
      }
    } 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, 1900, __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, 1900, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1900, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_schema = values[0];
    __pyx_v_generator = values[1];
    __pyx_v_options = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1900, __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("pyarrow._flight.GeneratorStream.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_15GeneratorStream___init__(((struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)__pyx_v_self), __pyx_v_schema, __pyx_v_generator, __pyx_v_options);

  /* 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_7pyarrow_7_flight_15GeneratorStream___init__(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self, PyObject *__pyx_v_schema, PyObject *__pyx_v_generator, PyObject *__pyx_v_options) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Schema>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
   arrow::ipc::IpcWriteOptions __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":1914
 *         options : pyarrow.ipc.IpcWriteOptions, optional
 *         """
 *         self.schema = pyarrow_unwrap_schema(schema)             # <<<<<<<<<<<<<<
 *         self.generator = iter(generator)
 *         self.c_options = _get_options(options).c_options
*/
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema(__pyx_v_schema); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1914, __pyx_L1_error)
  __pyx_v_self->schema = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pyarrow/_flight.pyx":1915
 *         """
 *         self.schema = pyarrow_unwrap_schema(schema)
 *         self.generator = iter(generator)             # <<<<<<<<<<<<<<
 *         self.c_options = _get_options(options).c_options
 * 
*/
  __pyx_t_2 = PyObject_GetIter(__pyx_v_generator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->generator);
  __Pyx_DECREF(__pyx_v_self->generator);
  __pyx_v_self->generator = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1916
 *         self.schema = pyarrow_unwrap_schema(schema)
 *         self.generator = iter(generator)
 *         self.c_options = _get_options(options).c_options             # <<<<<<<<<<<<<<
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_7_flight__get_options(__pyx_v_options)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *)__pyx_t_2)->c_options;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->c_options = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pyarrow/_flight.pyx":1900
 *         CIpcWriteOptions c_options
 * 
 *     def __init__(self, schema, generator, options=None):             # <<<<<<<<<<<<<<
 *         """Create a GeneratorStream from a Python generator.
 * 
*/

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

/* "pyarrow/_flight.pyx":1918
 *         self.c_options = _get_options(options).c_options
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             function[cb_data_stream_next] callback = &_data_stream_next
*/

static  arrow::flight::FlightDataStream *__pyx_f_7pyarrow_7_flight_15GeneratorStream_to_stream(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_self) {
  std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_data_stream_next>  __pyx_v_callback;
   arrow::flight::FlightDataStream *__pyx_r;

  /* "pyarrow/_flight.pyx":1920
 *     cdef CFlightDataStream* to_stream(self) except *:
 *         cdef:
 *             function[cb_data_stream_next] callback = &_data_stream_next             # <<<<<<<<<<<<<<
 *         return new CPyGeneratorFlightDataStream(self, self.schema, callback,
 *                                                 self.c_options)
*/
  __pyx_v_callback = (&__pyx_f_7pyarrow_7_flight__data_stream_next);

  /* "pyarrow/_flight.pyx":1921
 *         cdef:
 *             function[cb_data_stream_next] callback = &_data_stream_next
 *         return new CPyGeneratorFlightDataStream(self, self.schema, callback,             # <<<<<<<<<<<<<<
 *                                                 self.c_options)
 * 
*/
  __pyx_r = new  arrow::py::flight::PyGeneratorFlightDataStream(((PyObject *)__pyx_v_self), __pyx_v_self->schema, __pyx_v_callback, __pyx_v_self->c_options);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1918
 *         self.c_options = _get_options(options).c_options
 * 
 *     cdef CFlightDataStream* to_stream(self) except *:             # <<<<<<<<<<<<<<
 *         cdef:
 *             function[cb_data_stream_next] callback = &_data_stream_next
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__, "GeneratorStream.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__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.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_current_stre, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__, "GeneratorStream.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.GeneratorStream.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)__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_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__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.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_c_options_self_current_stre, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1930
 *         const CServerCallContext* context
 * 
 *     def peer_identity(self):             # <<<<<<<<<<<<<<
 *         """Get the identity of the authenticated peer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_1peer_identity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_peer_identity, "ServerCallContext.peer_identity(self)\n\nGet the identity of the authenticated peer.\n\nMay be the empty string.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_1peer_identity = {"peer_identity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_1peer_identity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_peer_identity};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_1peer_identity(PyObject *__pyx_v_self, 
#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("peer_identity (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("peer_identity", 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("peer_identity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_peer_identity(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self));

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

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

  /* "pyarrow/_flight.pyx":1935
 *         May be the empty string.
 *         """
 *         return tobytes(self.context.peer_identity())             # <<<<<<<<<<<<<<
 * 
 *     def peer(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->context->peer_identity()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1935, __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((PyObject*)__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, 1935, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1930
 *         const CServerCallContext* context
 * 
 *     def peer_identity(self):             # <<<<<<<<<<<<<<
 *         """Get the identity of the authenticated peer.
 * 
*/

  /* 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("pyarrow._flight.ServerCallContext.peer_identity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1937
 *         return tobytes(self.context.peer_identity())
 * 
 *     def peer(self):             # <<<<<<<<<<<<<<
 *         """Get the address of the peer."""
 *         # Set safe=True as gRPC on Windows sometimes gives garbage bytes
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_3peer(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_2peer, "ServerCallContext.peer(self)\n\nGet the address of the peer.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_3peer = {"peer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_3peer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_2peer};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_3peer(PyObject *__pyx_v_self, 
#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("peer (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("peer", 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("peer", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_2peer(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_2peer(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("peer", 0);

  /* "pyarrow/_flight.pyx":1940
 *         """Get the address of the peer."""
 *         # Set safe=True as gRPC on Windows sometimes gives garbage bytes
 *         return frombytes(self.context.peer(), safe=True)             # <<<<<<<<<<<<<<
 * 
 *     def is_cancelled(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_self->context->peer()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1940, __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 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_safe, Py_True, __pyx_t_6, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1940, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1937
 *         return tobytes(self.context.peer_identity())
 * 
 *     def peer(self):             # <<<<<<<<<<<<<<
 *         """Get the address of the peer."""
 *         # Set safe=True as gRPC on Windows sometimes gives garbage bytes
*/

  /* 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_AddTraceback("pyarrow._flight.ServerCallContext.peer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1942
 *         return frombytes(self.context.peer(), safe=True)
 * 
 *     def is_cancelled(self):             # <<<<<<<<<<<<<<
 *         """Check if the current RPC call has been canceled by the client."""
 *         return self.context.is_cancelled()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_5is_cancelled(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_4is_cancelled, "ServerCallContext.is_cancelled(self)\n\nCheck if the current RPC call has been canceled by the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_5is_cancelled = {"is_cancelled", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_5is_cancelled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_4is_cancelled};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_5is_cancelled(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_cancelled (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("is_cancelled", 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("is_cancelled", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_4is_cancelled(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_4is_cancelled(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__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("is_cancelled", 0);

  /* "pyarrow/_flight.pyx":1944
 *     def is_cancelled(self):
 *         """Check if the current RPC call has been canceled by the client."""
 *         return self.context.is_cancelled()             # <<<<<<<<<<<<<<
 * 
 *     def add_header(self, key, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->context->is_cancelled()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1942
 *         return frombytes(self.context.peer(), safe=True)
 * 
 *     def is_cancelled(self):             # <<<<<<<<<<<<<<
 *         """Check if the current RPC call has been canceled by the client."""
 *         return self.context.is_cancelled()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.ServerCallContext.is_cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1946
 *         return self.context.is_cancelled()
 * 
 *     def add_header(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response header."""
 *         self.context.AddHeader(tobytes(key), tobytes(value))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_7add_header(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_6add_header, "ServerCallContext.add_header(self, key, value)\n\nAdd a response header.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_7add_header = {"add_header", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_7add_header, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_6add_header};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_7add_header(PyObject *__pyx_v_self, 
#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;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_header (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_value,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, 1946, __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, 1946, __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, 1946, __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_header", 0) < (0)) __PYX_ERR(0, 1946, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_header", 1, 2, 2, i); __PYX_ERR(0, 1946, __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, 1946, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1946, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_header", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1946, __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("pyarrow._flight.ServerCallContext.add_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_6add_header(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* 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_7pyarrow_7_flight_17ServerCallContext_6add_header(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_header", 0);

  /* "pyarrow/_flight.pyx":1948
 *     def add_header(self, key, value):
 *         """Add a response header."""
 *         self.context.AddHeader(tobytes(key), tobytes(value))             # <<<<<<<<<<<<<<
 * 
 *     def add_trailer(self, key, value):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1948, __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_v_key};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->context->AddHeader(__pyx_t_5, __pyx_t_6);

  /* "pyarrow/_flight.pyx":1946
 *         return self.context.is_cancelled()
 * 
 *     def add_header(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response header."""
 *         self.context.AddHeader(tobytes(key), tobytes(value))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ServerCallContext.add_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1950
 *         self.context.AddHeader(tobytes(key), tobytes(value))
 * 
 *     def add_trailer(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response trailer."""
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_9add_trailer(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_8add_trailer, "ServerCallContext.add_trailer(self, key, value)\n\nAdd a response trailer.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_9add_trailer = {"add_trailer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_9add_trailer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_8add_trailer};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_9add_trailer(PyObject *__pyx_v_self, 
#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;
  PyObject *__pyx_v_value = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_trailer (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_value,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, 1950, __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, 1950, __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, 1950, __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_trailer", 0) < (0)) __PYX_ERR(0, 1950, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_trailer", 1, 2, 2, i); __PYX_ERR(0, 1950, __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, 1950, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1950, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_trailer", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1950, __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("pyarrow._flight.ServerCallContext.add_trailer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_8add_trailer(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* 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_7pyarrow_7_flight_17ServerCallContext_8add_trailer(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  std::string __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_trailer", 0);

  /* "pyarrow/_flight.pyx":1952
 *     def add_trailer(self, key, value):
 *         """Add a response trailer."""
 *         self.context.AddTrailer(tobytes(key), tobytes(value))             # <<<<<<<<<<<<<<
 * 
 *     def get_middleware(self, key):
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __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_v_key};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->context->AddTrailer(__pyx_t_5, __pyx_t_6);

  /* "pyarrow/_flight.pyx":1950
 *         self.context.AddHeader(tobytes(key), tobytes(value))
 * 
 *     def add_trailer(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response trailer."""
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ServerCallContext.add_trailer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1954
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
 * 
 *     def get_middleware(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a middleware instance by key.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_11get_middleware(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_10get_middleware, "ServerCallContext.get_middleware(self, key)\n\nGet a middleware instance by key.\n\nReturns None if the middleware was not found.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_11get_middleware = {"get_middleware", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_11get_middleware, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_10get_middleware};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_11get_middleware(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_middleware (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, 1954, __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, 1954, __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_middleware", 0) < (0)) __PYX_ERR(0, 1954, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_middleware", 1, 1, 1, i); __PYX_ERR(0, 1954, __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, 1954, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_middleware", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1954, __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("pyarrow._flight.ServerCallContext.get_middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_10get_middleware(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__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_7pyarrow_7_flight_17ServerCallContext_10get_middleware(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_self, PyObject *__pyx_v_key) {
   arrow::flight::ServerMiddleware *__pyx_v_c_middleware;
   arrow::py::flight::PyServerMiddleware *__pyx_v_middleware;
  std::vector< arrow::flight::TracingServerMiddleware::TraceKey>  __pyx_v_c_trace_context;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_py_middleware = NULL;
  PyObject *__pyx_v_trace_context = NULL;
   arrow::flight::TracingServerMiddleware::TraceKey __pyx_8genexpr2__pyx_v_pair;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  void *__pyx_t_7;
  std::vector< arrow::flight::TracingServerMiddleware::TraceKey> ::iterator __pyx_t_8;
   arrow::flight::TracingServerMiddleware::TraceKey __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_middleware", 0);

  /* "pyarrow/_flight.pyx":1962
 *         cdef:
 *             CServerMiddleware* c_middleware = \
 *                 self.context.GetMiddleware(CPyServerMiddlewareName)             # <<<<<<<<<<<<<<
 *             CPyServerMiddleware* middleware
 *             vector[CTracingServerMiddlewareTraceKey] c_trace_context
*/
  __pyx_v_c_middleware = __pyx_v_self->context->GetMiddleware( arrow::py::flight::kPyServerMiddlewareName);

  /* "pyarrow/_flight.pyx":1965
 *             CPyServerMiddleware* middleware
 *             vector[CTracingServerMiddlewareTraceKey] c_trace_context
 *         if c_middleware == NULL:             # <<<<<<<<<<<<<<
 *             c_middleware = self.context.GetMiddleware(tobytes(key))
 * 
*/
  __pyx_t_1 = (__pyx_v_c_middleware == NULL);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1966
 *             vector[CTracingServerMiddlewareTraceKey] c_trace_context
 *         if c_middleware == NULL:
 *             c_middleware = self.context.GetMiddleware(tobytes(key))             # <<<<<<<<<<<<<<
 * 
 *         if c_middleware == NULL:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1966, __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_v_key};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 1966, __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, 1966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_c_middleware = __pyx_v_self->context->GetMiddleware(__pyx_t_6);

    /* "pyarrow/_flight.pyx":1965
 *             CPyServerMiddleware* middleware
 *             vector[CTracingServerMiddlewareTraceKey] c_trace_context
 *         if c_middleware == NULL:             # <<<<<<<<<<<<<<
 *             c_middleware = self.context.GetMiddleware(tobytes(key))
 * 
*/
  }

  /* "pyarrow/_flight.pyx":1968
 *             c_middleware = self.context.GetMiddleware(tobytes(key))
 * 
 *         if c_middleware == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         elif c_middleware.name() == CPyServerMiddlewareName:
*/
  __pyx_t_1 = (__pyx_v_c_middleware == NULL);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1969
 * 
 *         if c_middleware == NULL:
 *             return None             # <<<<<<<<<<<<<<
 *         elif c_middleware.name() == CPyServerMiddlewareName:
 *             middleware = <CPyServerMiddleware*> c_middleware
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1968
 *             c_middleware = self.context.GetMiddleware(tobytes(key))
 * 
 *         if c_middleware == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         elif c_middleware.name() == CPyServerMiddlewareName:
*/
  }

  /* "pyarrow/_flight.pyx":1970
 *         if c_middleware == NULL:
 *             return None
 *         elif c_middleware.name() == CPyServerMiddlewareName:             # <<<<<<<<<<<<<<
 *             middleware = <CPyServerMiddleware*> c_middleware
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
*/
  __pyx_t_1 = (__pyx_v_c_middleware->name() ==  arrow::py::flight::kPyServerMiddlewareName);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1971
 *             return None
 *         elif c_middleware.name() == CPyServerMiddlewareName:
 *             middleware = <CPyServerMiddleware*> c_middleware             # <<<<<<<<<<<<<<
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
 *             return py_middleware.middleware.get(key)
*/
    __pyx_v_middleware = (( arrow::py::flight::PyServerMiddleware *)__pyx_v_c_middleware);

    /* "pyarrow/_flight.pyx":1972
 *         elif c_middleware.name() == CPyServerMiddlewareName:
 *             middleware = <CPyServerMiddleware*> c_middleware
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()             # <<<<<<<<<<<<<<
 *             return py_middleware.middleware.get(key)
 *         elif c_middleware.name() == CTracingServerMiddlewareName:
*/
    __pyx_t_7 = __pyx_v_middleware->py_object();
    __pyx_t_2 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_py_middleware = ((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":1973
 *             middleware = <CPyServerMiddleware*> c_middleware
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
 *             return py_middleware.middleware.get(key)             # <<<<<<<<<<<<<<
 *         elif c_middleware.name() == CTracingServerMiddlewareName:
 *             c_trace_context = (<CTracingServerMiddleware*> c_middleware
*/
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(__pyx_v_py_middleware->middleware == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(0, 1973, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_py_middleware->middleware, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1970
 *         if c_middleware == NULL:
 *             return None
 *         elif c_middleware.name() == CPyServerMiddlewareName:             # <<<<<<<<<<<<<<
 *             middleware = <CPyServerMiddleware*> c_middleware
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
*/
  }

  /* "pyarrow/_flight.pyx":1974
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
 *             return py_middleware.middleware.get(key)
 *         elif c_middleware.name() == CTracingServerMiddlewareName:             # <<<<<<<<<<<<<<
 *             c_trace_context = (<CTracingServerMiddleware*> c_middleware
 *                                ).GetTraceContext()
*/
  __pyx_t_1 = (__pyx_v_c_middleware->name() ==  arrow::flight::TracingServerMiddleware::kMiddlewareName);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":1976
 *         elif c_middleware.name() == CTracingServerMiddlewareName:
 *             c_trace_context = (<CTracingServerMiddleware*> c_middleware
 *                                ).GetTraceContext()             # <<<<<<<<<<<<<<
 *             trace_context = {pair.key: pair.value for pair in c_trace_context}
 *             return TracingServerMiddleware(trace_context)
*/
    __pyx_v_c_trace_context = (( arrow::flight::TracingServerMiddleware *)__pyx_v_c_middleware)->GetTraceContext();

    /* "pyarrow/_flight.pyx":1977
 *             c_trace_context = (<CTracingServerMiddleware*> c_middleware
 *                                ).GetTraceContext()
 *             trace_context = {pair.key: pair.value for pair in c_trace_context}             # <<<<<<<<<<<<<<
 *             return TracingServerMiddleware(trace_context)
 *         return None
*/
    { /* enter inner scope */
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __pyx_v_c_trace_context.begin();
      for (; __pyx_t_8 != __pyx_v_c_trace_context.end(); ++__pyx_t_8) {
        __pyx_t_9 = *__pyx_t_8;
        __pyx_8genexpr2__pyx_v_pair = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);
        __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_8genexpr2__pyx_v_pair.key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_8genexpr2__pyx_v_pair.value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1977, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    } /* exit inner scope */
    __pyx_v_trace_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":1978
 *                                ).GetTraceContext()
 *             trace_context = {pair.key: pair.value for pair in c_trace_context}
 *             return TracingServerMiddleware(trace_context)             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __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_v_trace_context};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__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, 1978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":1974
 *             py_middleware = <_ServerMiddlewareWrapper> middleware.py_object()
 *             return py_middleware.middleware.get(key)
 *         elif c_middleware.name() == CTracingServerMiddlewareName:             # <<<<<<<<<<<<<<
 *             c_trace_context = (<CTracingServerMiddleware*> c_middleware
 *                                ).GetTraceContext()
*/
  }

  /* "pyarrow/_flight.pyx":1979
 *             trace_context = {pair.key: pair.value for pair in c_trace_context}
 *             return TracingServerMiddleware(trace_context)
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1954
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
 * 
 *     def get_middleware(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a middleware instance by key.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.ServerCallContext.get_middleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_middleware);
  __Pyx_XDECREF(__pyx_v_trace_context);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":1981
 *         return None
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerCallContext wrap(const CServerCallContext& context):
 *         cdef ServerCallContext result = \
*/

static struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap( arrow::flight::ServerCallContext const &__pyx_v_context) {
  struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":1984
 *     cdef ServerCallContext wrap(const CServerCallContext& context):
 *         cdef ServerCallContext result = \
 *             ServerCallContext.__new__(ServerCallContext)             # <<<<<<<<<<<<<<
 *         result.context = &context
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_ServerCallContext(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":1985
 *         cdef ServerCallContext result = \
 *             ServerCallContext.__new__(ServerCallContext)
 *         result.context = &context             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->context = (&__pyx_v_context);

  /* "pyarrow/_flight.pyx":1986
 *             ServerCallContext.__new__(ServerCallContext)
 *         result.context = &context
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1981
 *         return None
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerCallContext wrap(const CServerCallContext& context):
 *         cdef ServerCallContext result = \
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__, "ServerCallContext.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__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.context cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.context cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_context_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ServerCallContext.__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.context cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.context cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__, "ServerCallContext.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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("pyarrow._flight.ServerCallContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)__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_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *__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.context cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.context cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_context_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":1994
 *         CServerAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_1read(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthReader_read, "ServerAuthReader.read(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_1read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_read};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_1read(PyObject *__pyx_v_self, 
#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("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);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read", 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("read", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerAuthReader_read(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthReader_read(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self) {
  std::string __pyx_v_token;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/_flight.pyx":1996
 *     def read(self):
 *         cdef c_string token
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ServerAuthReader outside "
 *                              "ServerAuthHandler.authenticate")
*/
  __pyx_t_1 = (!(__pyx_v_self->reader != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":1997
 *         cdef c_string token
 *         if not self.reader:
 *             raise ValueError("Cannot use ServerAuthReader outside "             # <<<<<<<<<<<<<<
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_use_ServerAuthReader_outs};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __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, 1997, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":1996
 *     def read(self):
 *         cdef c_string token
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ServerAuthReader outside "
 *                              "ServerAuthHandler.authenticate")
*/
  }

  /* "pyarrow/_flight.pyx":1999
 *             raise ValueError("Cannot use ServerAuthReader outside "
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.Read(&token))
 *         return token
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2000
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:
 *             check_flight_status(self.reader.Read(&token))             # <<<<<<<<<<<<<<
 *         return token
 * 
*/
        __pyx_t_5 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader->Read((&__pyx_v_token))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2000, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":1999
 *             raise ValueError("Cannot use ServerAuthReader outside "
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.Read(&token))
 *         return token
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":2001
 *         with nogil:
 *             check_flight_status(self.reader.Read(&token))
 *         return token             # <<<<<<<<<<<<<<
 * 
 *     cdef void poison(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":1994
 *         CServerAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2003
 *         return token
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

static void __pyx_f_7pyarrow_7_flight_16ServerAuthReader_poison(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_self) {

  /* "pyarrow/_flight.pyx":2010
 *         the reference goes away.
 *         """
 *         self.reader = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->reader = NULL;

  /* "pyarrow/_flight.pyx":2003
 *         return token
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

  /* function exit code */
}

/* "pyarrow/_flight.pyx":2012
 *         self.reader = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerAuthReader wrap(CServerAuthReader* reader):
 *         cdef ServerAuthReader result = \
*/

static struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_f_7pyarrow_7_flight_16ServerAuthReader_wrap( arrow::flight::ServerAuthReader *__pyx_v_reader) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":2015
 *     cdef ServerAuthReader wrap(CServerAuthReader* reader):
 *         cdef ServerAuthReader result = \
 *             ServerAuthReader.__new__(ServerAuthReader)             # <<<<<<<<<<<<<<
 *         result.reader = reader
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_ServerAuthReader(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2015, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2016
 *         cdef ServerAuthReader result = \
 *             ServerAuthReader.__new__(ServerAuthReader)
 *         result.reader = reader             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->reader = __pyx_v_reader;

  /* "pyarrow/_flight.pyx":2017
 *             ServerAuthReader.__new__(ServerAuthReader)
 *         result.reader = reader
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2012
 *         self.reader = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerAuthReader wrap(CServerAuthReader* reader):
 *         cdef ServerAuthReader result = \
*/

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

/* "(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_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__, "ServerAuthReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.ServerAuthReader.__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_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__, "ServerAuthReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.ServerAuthReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)__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_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.ServerAuthReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2025
 *         CServerAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_1write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthSender_write, "ServerAuthSender.write(self, message)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_1write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_write};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_1write(PyObject *__pyx_v_self, 
#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_message = 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_message,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, 2025, __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, 2025, __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, 2025, __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, 2025, __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, 2025, __pyx_L3_error)
    }
    __pyx_v_message = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2025, __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("pyarrow._flight.ServerAuthSender.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerAuthSender_write(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)__pyx_v_self), __pyx_v_message);

  /* 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_7pyarrow_7_flight_16ServerAuthSender_write(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self, PyObject *__pyx_v_message) {
  std::string __pyx_v_c_message;
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/_flight.pyx":2026
 * 
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)             # <<<<<<<<<<<<<<
 *         if not self.sender:
 *             raise ValueError("Cannot use ServerAuthSender outside "
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __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_v_message};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 2026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2026, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_message = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":2027
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ServerAuthSender outside "
 *                              "ServerAuthHandler.authenticate")
*/
  __pyx_t_6 = (!(__pyx_v_self->sender != 0));
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_flight.pyx":2028
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
 *             raise ValueError("Cannot use ServerAuthSender outside "             # <<<<<<<<<<<<<<
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_use_ServerAuthSender_outs};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __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, 2028, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2027
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ServerAuthSender outside "
 *                              "ServerAuthHandler.authenticate")
*/
  }

  /* "pyarrow/_flight.pyx":2030
 *             raise ValueError("Cannot use ServerAuthSender outside "
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.sender.Write(c_message))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2031
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:
 *             check_flight_status(self.sender.Write(c_message))             # <<<<<<<<<<<<<<
 * 
 *     cdef void poison(self):
*/
        __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->sender->Write(__pyx_v_c_message)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2031, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":2030
 *             raise ValueError("Cannot use ServerAuthSender outside "
 *                              "ServerAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.sender.Write(c_message))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":2025
 *         CServerAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthSender.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2033
 *             check_flight_status(self.sender.Write(c_message))
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

static void __pyx_f_7pyarrow_7_flight_16ServerAuthSender_poison(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_self) {

  /* "pyarrow/_flight.pyx":2040
 *         the reference goes away.
 *         """
 *         self.sender = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->sender = NULL;

  /* "pyarrow/_flight.pyx":2033
 *             check_flight_status(self.sender.Write(c_message))
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

  /* function exit code */
}

/* "pyarrow/_flight.pyx":2042
 *         self.sender = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerAuthSender wrap(CServerAuthSender* sender):
 *         cdef ServerAuthSender result = \
*/

static struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_f_7pyarrow_7_flight_16ServerAuthSender_wrap( arrow::flight::ServerAuthSender *__pyx_v_sender) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":2045
 *     cdef ServerAuthSender wrap(CServerAuthSender* sender):
 *         cdef ServerAuthSender result = \
 *             ServerAuthSender.__new__(ServerAuthSender)             # <<<<<<<<<<<<<<
 *         result.sender = sender
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_ServerAuthSender(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2046
 *         cdef ServerAuthSender result = \
 *             ServerAuthSender.__new__(ServerAuthSender)
 *         result.sender = sender             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->sender = __pyx_v_sender;

  /* "pyarrow/_flight.pyx":2047
 *             ServerAuthSender.__new__(ServerAuthSender)
 *         result.sender = sender
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2042
 *         self.sender = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ServerAuthSender wrap(CServerAuthSender* sender):
 *         cdef ServerAuthSender result = \
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__, "ServerAuthSender.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__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.sender cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_sender_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthSender.__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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__, "ServerAuthSender.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.ServerAuthSender.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)__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_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_sender_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":2055
 *         CClientAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_1read(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthReader_read, "ClientAuthReader.read(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_1read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_read};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_1read(PyObject *__pyx_v_self, 
#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("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);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("read", 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("read", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientAuthReader_read(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthReader_read(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self) {
  std::string __pyx_v_token;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/_flight.pyx":2057
 *     def read(self):
 *         cdef c_string token
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ClientAuthReader outside "
 *                              "ClientAuthHandler.authenticate")
*/
  __pyx_t_1 = (!(__pyx_v_self->reader != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":2058
 *         cdef c_string token
 *         if not self.reader:
 *             raise ValueError("Cannot use ClientAuthReader outside "             # <<<<<<<<<<<<<<
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_use_ClientAuthReader_outs};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __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, 2058, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2057
 *     def read(self):
 *         cdef c_string token
 *         if not self.reader:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ClientAuthReader outside "
 *                              "ClientAuthHandler.authenticate")
*/
  }

  /* "pyarrow/_flight.pyx":2060
 *             raise ValueError("Cannot use ClientAuthReader outside "
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.Read(&token))
 *         return token
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2061
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:
 *             check_flight_status(self.reader.Read(&token))             # <<<<<<<<<<<<<<
 *         return token
 * 
*/
        __pyx_t_5 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->reader->Read((&__pyx_v_token))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2061, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":2060
 *             raise ValueError("Cannot use ClientAuthReader outside "
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.reader.Read(&token))
 *         return token
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":2062
 *         with nogil:
 *             check_flight_status(self.reader.Read(&token))
 *         return token             # <<<<<<<<<<<<<<
 * 
 *     cdef void poison(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_token); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2055
 *         CClientAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthReader.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2064
 *         return token
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

static void __pyx_f_7pyarrow_7_flight_16ClientAuthReader_poison(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_self) {

  /* "pyarrow/_flight.pyx":2071
 *         the reference goes away.
 *         """
 *         self.reader = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->reader = NULL;

  /* "pyarrow/_flight.pyx":2064
 *         return token
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

  /* function exit code */
}

/* "pyarrow/_flight.pyx":2073
 *         self.reader = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ClientAuthReader wrap(CClientAuthReader* reader):
 *         cdef ClientAuthReader result = \
*/

static struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_f_7pyarrow_7_flight_16ClientAuthReader_wrap( arrow::flight::ClientAuthReader *__pyx_v_reader) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":2076
 *     cdef ClientAuthReader wrap(CClientAuthReader* reader):
 *         cdef ClientAuthReader result = \
 *             ClientAuthReader.__new__(ClientAuthReader)             # <<<<<<<<<<<<<<
 *         result.reader = reader
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_ClientAuthReader(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2077
 *         cdef ClientAuthReader result = \
 *             ClientAuthReader.__new__(ClientAuthReader)
 *         result.reader = reader             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->reader = __pyx_v_reader;

  /* "pyarrow/_flight.pyx":2078
 *             ClientAuthReader.__new__(ClientAuthReader)
 *         result.reader = reader
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2073
 *         self.reader = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ClientAuthReader wrap(CClientAuthReader* reader):
 *         cdef ClientAuthReader result = \
*/

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

/* "(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_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__, "ClientAuthReader.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.ClientAuthReader.__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_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__, "ClientAuthReader.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.ClientAuthReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)__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_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__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(((PyObject *)(((PyTypeObject*)PyExc_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("pyarrow._flight.ClientAuthReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2086
 *         CClientAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_1write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthSender_write, "ClientAuthSender.write(self, message)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_1write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_write};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_1write(PyObject *__pyx_v_self, 
#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_message = 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_message,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, 2086, __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, 2086, __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, 2086, __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, 2086, __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, 2086, __pyx_L3_error)
    }
    __pyx_v_message = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2086, __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("pyarrow._flight.ClientAuthSender.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientAuthSender_write(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)__pyx_v_self), __pyx_v_message);

  /* 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_7pyarrow_7_flight_16ClientAuthSender_write(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self, PyObject *__pyx_v_message) {
  std::string __pyx_v_c_message;
  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;
  std::string __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/_flight.pyx":2087
 * 
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)             # <<<<<<<<<<<<<<
 *         if not self.sender:
 *             raise ValueError("Cannot use ClientAuthSender outside "
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2087, __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_v_message};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 2087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_message = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5);

  /* "pyarrow/_flight.pyx":2088
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ClientAuthSender outside "
 *                              "ClientAuthHandler.authenticate")
*/
  __pyx_t_6 = (!(__pyx_v_self->sender != 0));
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_flight.pyx":2089
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
 *             raise ValueError("Cannot use ClientAuthSender outside "             # <<<<<<<<<<<<<<
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_use_ClientAuthSender_outs};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2089, __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, 2089, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2088
 *     def write(self, message):
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:             # <<<<<<<<<<<<<<
 *             raise ValueError("Cannot use ClientAuthSender outside "
 *                              "ClientAuthHandler.authenticate")
*/
  }

  /* "pyarrow/_flight.pyx":2091
 *             raise ValueError("Cannot use ClientAuthSender outside "
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.sender.Write(c_message))
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2092
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:
 *             check_flight_status(self.sender.Write(c_message))             # <<<<<<<<<<<<<<
 * 
 *     cdef void poison(self):
*/
        __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->sender->Write(__pyx_v_c_message)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2092, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":2091
 *             raise ValueError("Cannot use ClientAuthSender outside "
 *                              "ClientAuthHandler.authenticate")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.sender.Write(c_message))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":2086
 *         CClientAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthSender.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2094
 *             check_flight_status(self.sender.Write(c_message))
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

static void __pyx_f_7pyarrow_7_flight_16ClientAuthSender_poison(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_self) {

  /* "pyarrow/_flight.pyx":2101
 *         the reference goes away.
 *         """
 *         self.sender = NULL             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
*/
  __pyx_v_self->sender = NULL;

  /* "pyarrow/_flight.pyx":2094
 *             check_flight_status(self.sender.Write(c_message))
 * 
 *     cdef void poison(self):             # <<<<<<<<<<<<<<
 *         """Prevent further usage of this object.
 * 
*/

  /* function exit code */
}

/* "pyarrow/_flight.pyx":2103
 *         self.sender = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ClientAuthSender wrap(CClientAuthSender* sender):
 *         cdef ClientAuthSender result = \
*/

static struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_f_7pyarrow_7_flight_16ClientAuthSender_wrap( arrow::flight::ClientAuthSender *__pyx_v_sender) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap", 0);

  /* "pyarrow/_flight.pyx":2106
 *     cdef ClientAuthSender wrap(CClientAuthSender* sender):
 *         cdef ClientAuthSender result = \
 *             ClientAuthSender.__new__(ClientAuthSender)             # <<<<<<<<<<<<<<
 *         result.sender = sender
 *         return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_ClientAuthSender(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2107
 *         cdef ClientAuthSender result = \
 *             ClientAuthSender.__new__(ClientAuthSender)
 *         result.sender = sender             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_v_result->sender = __pyx_v_sender;

  /* "pyarrow/_flight.pyx":2108
 *             ClientAuthSender.__new__(ClientAuthSender)
 *         result.sender = sender
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2103
 *         self.sender = NULL
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef ClientAuthSender wrap(CClientAuthSender* sender):
 *         cdef ClientAuthSender result = \
*/

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

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

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__, "ClientAuthSender.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__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.sender cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_sender_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthSender.__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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__, "ClientAuthSender.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight.ClientAuthSender.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)__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_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_sender_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":2111
 * 
 * 
 * cdef CStatus _data_stream_next(void* self, CFlightPayload* payload) except *:             # <<<<<<<<<<<<<<
 *     """Callback for implementing FlightDataStream in Python."""
 *     cdef:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__data_stream_next(void *__pyx_v_self,  arrow::flight::FlightPayload *__pyx_v_payload) {
  std::unique_ptr< arrow::flight::FlightDataStream>  __pyx_v_data_stream;
  PyObject *__pyx_v_py_stream = NULL;
  struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *__pyx_v_stream = NULL;
  long __pyx_v_max_attempts;
  CYTHON_UNUSED long __pyx_v__;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  PyObject *__pyx_v_metadata = NULL;
  PyObject *__pyx_v_stream_schema = NULL;
  PyObject *__pyx_v_substream_schema = NULL;
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  long __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  arrow::Status __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;
  PyObject *(*__pyx_t_23)(PyObject *);
   arrow::flight::FlightDataStream *__pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26[4];
  PyObject *__pyx_t_27 = NULL;
  std::shared_ptr< arrow::Buffer>  __pyx_t_28;
  PyObject *__pyx_t_29[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_data_stream_next", 0);

  /* "pyarrow/_flight.pyx":2116
 *         unique_ptr[CFlightDataStream] data_stream
 * 
 *     py_stream = <object> self             # <<<<<<<<<<<<<<
 *     if not isinstance(py_stream, GeneratorStream):
 *         raise RuntimeError("self object in callback is not GeneratorStream")
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_py_stream = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2117
 * 
 *     py_stream = <object> self
 *     if not isinstance(py_stream, GeneratorStream):             # <<<<<<<<<<<<<<
 *         raise RuntimeError("self object in callback is not GeneratorStream")
 *     stream = <GeneratorStream> py_stream
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_py_stream, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_GeneratorStream); 
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/_flight.pyx":2118
 *     py_stream = <object> self
 *     if not isinstance(py_stream, GeneratorStream):
 *         raise RuntimeError("self object in callback is not GeneratorStream")             # <<<<<<<<<<<<<<
 *     stream = <GeneratorStream> py_stream
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_self_object_in_callback_is_not_G};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __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;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __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, 2118, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2117
 * 
 *     py_stream = <object> self
 *     if not isinstance(py_stream, GeneratorStream):             # <<<<<<<<<<<<<<
 *         raise RuntimeError("self object in callback is not GeneratorStream")
 *     stream = <GeneratorStream> py_stream
*/
  }

  /* "pyarrow/_flight.pyx":2119
 *     if not isinstance(py_stream, GeneratorStream):
 *         raise RuntimeError("self object in callback is not GeneratorStream")
 *     stream = <GeneratorStream> py_stream             # <<<<<<<<<<<<<<
 * 
 *     # The generator is allowed to yield a reader or table which we
*/
  __pyx_t_1 = __pyx_v_py_stream;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_stream = ((struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2125
 *     # try again. However, limit the number of attempts so that we
 *     # don't just spin forever.
 *     max_attempts = 128             # <<<<<<<<<<<<<<
 *     for _ in range(max_attempts):
 *         if stream.current_stream != nullptr:
*/
  __pyx_v_max_attempts = 0x80;

  /* "pyarrow/_flight.pyx":2126
 *     # don't just spin forever.
 *     max_attempts = 128
 *     for _ in range(max_attempts):             # <<<<<<<<<<<<<<
 *         if stream.current_stream != nullptr:
 *             with nogil:
*/
  __pyx_t_6 = __pyx_v_max_attempts;
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v__ = __pyx_t_8;

    /* "pyarrow/_flight.pyx":2127
 *     max_attempts = 128
 *     for _ in range(max_attempts):
 *         if stream.current_stream != nullptr:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_flight_status(
*/
    __pyx_t_3 = ((__pyx_v_stream->current_stream != nullptr) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/_flight.pyx":2128
 *     for _ in range(max_attempts):
 *         if stream.current_stream != nullptr:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     stream.current_stream.get().Next().Value(payload))
*/
      {
          PyThreadState * _save;
          _save = PyEval_SaveThread();
          __Pyx_FastGIL_Remember();
          /*try:*/ {

            /* "pyarrow/_flight.pyx":2129
 *         if stream.current_stream != nullptr:
 *             with nogil:
 *                 check_flight_status(             # <<<<<<<<<<<<<<
 *                     stream.current_stream.get().Next().Value(payload))
 *             # If the stream ended, see if there's another stream from the
*/
            __pyx_t_9 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_stream->current_stream.get()->Next().Value(__pyx_v_payload)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2129, __pyx_L10_error)
          }

          /* "pyarrow/_flight.pyx":2128
 *     for _ in range(max_attempts):
 *         if stream.current_stream != nullptr:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 check_flight_status(
 *                     stream.current_stream.get().Next().Value(payload))
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_FastGIL_Forget();
              PyEval_RestoreThread(_save);
              goto __pyx_L11;
            }
            __pyx_L10_error: {
              __Pyx_FastGIL_Forget();
              PyEval_RestoreThread(_save);
              goto __pyx_L1_error;
            }
            __pyx_L11:;
          }
      }

      /* "pyarrow/_flight.pyx":2133
 *             # If the stream ended, see if there's another stream from the
 *             # generator
 *             if payload.ipc_message.metadata != nullptr:             # <<<<<<<<<<<<<<
 *                 return CStatus_OK()
 *             stream.current_stream.reset(nullptr)
*/
      __pyx_t_3 = ((__pyx_v_payload->ipc_message.metadata != nullptr) != 0);
      if (__pyx_t_3) {

        /* "pyarrow/_flight.pyx":2134
 *             # generator
 *             if payload.ipc_message.metadata != nullptr:
 *                 return CStatus_OK()             # <<<<<<<<<<<<<<
 *             stream.current_stream.reset(nullptr)
 * 
*/
        __pyx_r = arrow::Status::OK();
        goto __pyx_L0;

        /* "pyarrow/_flight.pyx":2133
 *             # If the stream ended, see if there's another stream from the
 *             # generator
 *             if payload.ipc_message.metadata != nullptr:             # <<<<<<<<<<<<<<
 *                 return CStatus_OK()
 *             stream.current_stream.reset(nullptr)
*/
      }

      /* "pyarrow/_flight.pyx":2135
 *             if payload.ipc_message.metadata != nullptr:
 *                 return CStatus_OK()
 *             stream.current_stream.reset(nullptr)             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
      __pyx_v_stream->current_stream.reset(nullptr);

      /* "pyarrow/_flight.pyx":2127
 *     max_attempts = 128
 *     for _ in range(max_attempts):
 *         if stream.current_stream != nullptr:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_flight_status(
*/
    }

    /* "pyarrow/_flight.pyx":2137
 *             stream.current_stream.reset(nullptr)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             result = next(stream.generator)
 *         except StopIteration:
*/
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2138
 * 
 *         try:
 *             result = next(stream.generator)             # <<<<<<<<<<<<<<
 *         except StopIteration:
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)
*/
        __pyx_t_1 = __pyx_v_stream->generator;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2138, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "pyarrow/_flight.pyx":2137
 *             stream.current_stream.reset(nullptr)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             result = next(stream.generator)
 *         except StopIteration:
*/
      }
      __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;
      goto __pyx_L20_try_end;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2139
 *         try:
 *             result = next(stream.generator)
 *         except StopIteration:             # <<<<<<<<<<<<<<
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)
 *             return CStatus_OK()
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_StopIteration))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("pyarrow._flight._data_stream_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 2139, __pyx_L15_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_13);

        /* "pyarrow/_flight.pyx":2140
 *             result = next(stream.generator)
 *         except StopIteration:
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)             # <<<<<<<<<<<<<<
 *             return CStatus_OK()
 *         except FlightError as flight_error:
*/
        __pyx_v_payload->ipc_message.metadata.reset((( arrow::Buffer *)nullptr));

        /* "pyarrow/_flight.pyx":2141
 *         except StopIteration:
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)
 *             return CStatus_OK()             # <<<<<<<<<<<<<<
 *         except FlightError as flight_error:
 *             return (<FlightError> flight_error).to_status()
*/
        __pyx_r = arrow::Status::OK();
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L16_except_return;
      }

      /* "pyarrow/_flight.pyx":2142
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)
 *             return CStatus_OK()
 *         except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *             return (<FlightError> flight_error).to_status()
 * 
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("pyarrow._flight._data_stream_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 2142, __pyx_L15_except_error)
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_flight_error = __pyx_t_1;
        /*try:*/ {

          /* "pyarrow/_flight.pyx":2143
 *             return CStatus_OK()
 *         except FlightError as flight_error:
 *             return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(result, (list, tuple)):
*/
          __pyx_t_14 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2143, __pyx_L28_error)
          __pyx_r = __pyx_t_14;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L27_return;
        }

        /* "pyarrow/_flight.pyx":2142
 *             payload.ipc_message.metadata.reset(<CBuffer*> nullptr)
 *             return CStatus_OK()
 *         except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *             return (<FlightError> flight_error).to_status()
 * 
*/
        /*finally:*/ {
          __pyx_L28_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_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_9 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 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_9; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
            goto __pyx_L15_except_error;
          }
          __pyx_L27_return: {
            __pyx_t_14 = __pyx_r;
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
            __pyx_r = __pyx_t_14;
            goto __pyx_L16_except_return;
          }
        }
      }
      goto __pyx_L15_except_error;

      /* "pyarrow/_flight.pyx":2137
 *             stream.current_stream.reset(nullptr)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             result = next(stream.generator)
 *         except StopIteration:
*/
      __pyx_L15_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L16_except_return:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L0;
      __pyx_L20_try_end:;
    }

    /* "pyarrow/_flight.pyx":2145
 *             return (<FlightError> flight_error).to_status()
 * 
 *         if isinstance(result, (list, tuple)):             # <<<<<<<<<<<<<<
 *             result, metadata = result
 *         else:
*/
    __pyx_t_2 = PyList_Check(__pyx_v_result); 
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L35_bool_binop_done;
    }
    __pyx_t_2 = PyTuple_Check(__pyx_v_result); 
    __pyx_t_3 = __pyx_t_2;
    __pyx_L35_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyarrow/_flight.pyx":2146
 * 
 *         if isinstance(result, (list, tuple)):
 *             result, metadata = result             # <<<<<<<<<<<<<<
 *         else:
 *             result, metadata = result, None
*/
      if ((likely(PyTuple_CheckExact(__pyx_v_result))) || (PyList_CheckExact(__pyx_v_result))) {
        PyObject* sequence = __pyx_v_result;
        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, 2146, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_1);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2146, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_1);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_23 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13);
        index = 0; __pyx_t_4 = __pyx_t_23(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L37_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_1 = __pyx_t_23(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L37_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_23(__pyx_t_13), 2) < (0)) __PYX_ERR(0, 2146, __pyx_L1_error)
        __pyx_t_23 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L38_unpacking_done;
        __pyx_L37_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_23 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2146, __pyx_L1_error)
        __pyx_L38_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_metadata, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2145
 *             return (<FlightError> flight_error).to_status()
 * 
 *         if isinstance(result, (list, tuple)):             # <<<<<<<<<<<<<<
 *             result, metadata = result
 *         else:
*/
      goto __pyx_L34;
    }

    /* "pyarrow/_flight.pyx":2148
 *             result, metadata = result
 *         else:
 *             result, metadata = result, None             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(result, (Table, RecordBatchReader)):
*/
    /*else*/ {
      __pyx_t_1 = __pyx_v_result;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = Py_None;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_metadata, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L34:;

    /* "pyarrow/_flight.pyx":2150
 *             result, metadata = result, None
 * 
 *         if isinstance(result, (Table, RecordBatchReader)):             # <<<<<<<<<<<<<<
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "
*/
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_Table); 
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L40_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatchReader); 
    __pyx_t_3 = __pyx_t_2;
    __pyx_L40_bool_binop_done:;
    if (__pyx_t_3) {

      /* "pyarrow/_flight.pyx":2151
 * 
 *         if isinstance(result, (Table, RecordBatchReader)):
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
*/
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_metadata); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2151, __pyx_L1_error)
      if (unlikely(__pyx_t_3)) {

        /* "pyarrow/_flight.pyx":2152
 *         if isinstance(result, (Table, RecordBatchReader)):
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "             # <<<<<<<<<<<<<<
 *                                  "RecordBatch.")
 *             result = RecordBatchStream(result)
*/
        __pyx_t_1 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Can_only_return_metadata_alongsi};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __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, 2152, __pyx_L1_error)

        /* "pyarrow/_flight.pyx":2151
 * 
 *         if isinstance(result, (Table, RecordBatchReader)):
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
*/
      }

      /* "pyarrow/_flight.pyx":2154
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
 *             result = RecordBatchStream(result)             # <<<<<<<<<<<<<<
 * 
 *         stream_schema = pyarrow_wrap_schema(stream.schema)
*/
      __pyx_t_1 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_result};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2154, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2150
 *             result, metadata = result, None
 * 
 *         if isinstance(result, (Table, RecordBatchReader)):             # <<<<<<<<<<<<<<
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "
*/
    }

    /* "pyarrow/_flight.pyx":2156
 *             result = RecordBatchStream(result)
 * 
 *         stream_schema = pyarrow_wrap_schema(stream.schema)             # <<<<<<<<<<<<<<
 *         if isinstance(result, FlightDataStream):
 *             if metadata:
*/
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_stream->schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_stream_schema, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":2157
 * 
 *         stream_schema = pyarrow_wrap_schema(stream.schema)
 *         if isinstance(result, FlightDataStream):             # <<<<<<<<<<<<<<
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "
*/
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream); 
    if (__pyx_t_3) {

      /* "pyarrow/_flight.pyx":2158
 *         stream_schema = pyarrow_wrap_schema(stream.schema)
 *         if isinstance(result, FlightDataStream):
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
*/
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_metadata); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2158, __pyx_L1_error)
      if (unlikely(__pyx_t_3)) {

        /* "pyarrow/_flight.pyx":2159
 *         if isinstance(result, FlightDataStream):
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "             # <<<<<<<<<<<<<<
 *                                  "RecordBatch.")
 *             data_stream = unique_ptr[CFlightDataStream](
*/
        __pyx_t_1 = NULL;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Can_only_return_metadata_alongsi};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __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, 2159, __pyx_L1_error)

        /* "pyarrow/_flight.pyx":2158
 *         stream_schema = pyarrow_wrap_schema(stream.schema)
 *         if isinstance(result, FlightDataStream):
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
*/
      }

      /* "pyarrow/_flight.pyx":2162
 *                                  "RecordBatch.")
 *             data_stream = unique_ptr[CFlightDataStream](
 *                 (<FlightDataStream> result).to_stream())             # <<<<<<<<<<<<<<
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
 *             if substream_schema != stream_schema:
*/
      __pyx_t_24 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream *)((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v_result)->__pyx_vtab)->to_stream(((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v_result)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2162, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2161
 *                 raise ValueError("Can only return metadata alongside a "
 *                                  "RecordBatch.")
 *             data_stream = unique_ptr[CFlightDataStream](             # <<<<<<<<<<<<<<
 *                 (<FlightDataStream> result).to_stream())
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
*/
      __pyx_v_data_stream = std::unique_ptr< arrow::flight::FlightDataStream> (__pyx_t_24);

      /* "pyarrow/_flight.pyx":2163
 *             data_stream = unique_ptr[CFlightDataStream](
 *                 (<FlightDataStream> result).to_stream())
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())             # <<<<<<<<<<<<<<
 *             if substream_schema != stream_schema:
 *                 raise ValueError("Got a FlightDataStream whose schema "
*/
      __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_data_stream.get()->schema()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_substream_schema, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2164
 *                 (<FlightDataStream> result).to_stream())
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
 *             if substream_schema != stream_schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Got a FlightDataStream whose schema "
 *                                  "does not match the declared schema of this "
*/
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_substream_schema, __pyx_v_stream_schema, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(__pyx_t_3)) {

        /* "pyarrow/_flight.pyx":2165
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
 *             if substream_schema != stream_schema:
 *                 raise ValueError("Got a FlightDataStream whose schema "             # <<<<<<<<<<<<<<
 *                                  "does not match the declared schema of this "
 *                                  "GeneratorStream. "
*/
        __pyx_t_1 = NULL;

        /* "pyarrow/_flight.pyx":2168
 *                                  "does not match the declared schema of this "
 *                                  "GeneratorStream. "
 *                                  f"Got: {substream_schema}\nExpected: {stream_schema}")             # <<<<<<<<<<<<<<
 *             stream.current_stream.reset(
 *                 new CPyFlightDataStream(result, move(data_stream)))
*/
        __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_v_substream_schema, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_25 = __Pyx_PyObject_FormatSimple(__pyx_v_stream_schema, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_25);
        __pyx_t_26[0] = __pyx_mstate_global->__pyx_kp_u_Got_a_FlightDataStream_whose_sch;
        __pyx_t_26[1] = __pyx_t_13;
        __pyx_t_26[2] = __pyx_mstate_global->__pyx_kp_u_Expected;
        __pyx_t_26[3] = __pyx_t_25;

        /* "pyarrow/_flight.pyx":2165
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
 *             if substream_schema != stream_schema:
 *                 raise ValueError("Got a FlightDataStream whose schema "             # <<<<<<<<<<<<<<
 *                                  "does not match the declared schema of this "
 *                                  "GeneratorStream. "
*/
        __pyx_t_27 = __Pyx_PyUnicode_Join(__pyx_t_26, 4, 101 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25));
        if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2165, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_27};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2165, __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, 2165, __pyx_L1_error)

        /* "pyarrow/_flight.pyx":2164
 *                 (<FlightDataStream> result).to_stream())
 *             substream_schema = pyarrow_wrap_schema(data_stream.get().schema())
 *             if substream_schema != stream_schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Got a FlightDataStream whose schema "
 *                                  "does not match the declared schema of this "
*/
      }

      /* "pyarrow/_flight.pyx":2169
 *                                  "GeneratorStream. "
 *                                  f"Got: {substream_schema}\nExpected: {stream_schema}")
 *             stream.current_stream.reset(             # <<<<<<<<<<<<<<
 *                 new CPyFlightDataStream(result, move(data_stream)))
 *             # Loop around and try again
*/
      __pyx_v_stream->current_stream.reset(new  arrow::py::flight::PyFlightDataStream(__pyx_v_result, cython_std::move<std::unique_ptr< arrow::flight::FlightDataStream> >(__pyx_v_data_stream)));

      /* "pyarrow/_flight.pyx":2172
 *                 new CPyFlightDataStream(result, move(data_stream)))
 *             # Loop around and try again
 *             continue             # <<<<<<<<<<<<<<
 *         elif isinstance(result, RecordBatch):
 *             batch = <RecordBatch> result
*/
      goto __pyx_L4_continue;

      /* "pyarrow/_flight.pyx":2157
 * 
 *         stream_schema = pyarrow_wrap_schema(stream.schema)
 *         if isinstance(result, FlightDataStream):             # <<<<<<<<<<<<<<
 *             if metadata:
 *                 raise ValueError("Can only return metadata alongside a "
*/
    }

    /* "pyarrow/_flight.pyx":2173
 *             # Loop around and try again
 *             continue
 *         elif isinstance(result, RecordBatch):             # <<<<<<<<<<<<<<
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:
*/
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib_RecordBatch); 
    if (likely(__pyx_t_3)) {

      /* "pyarrow/_flight.pyx":2174
 *             continue
 *         elif isinstance(result, RecordBatch):
 *             batch = <RecordBatch> result             # <<<<<<<<<<<<<<
 *             if batch.schema != stream_schema:
 *                 raise ValueError("Got a RecordBatch whose schema does not "
*/
      __pyx_t_4 = __pyx_v_result;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_v_batch = ((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2175
 *         elif isinstance(result, RecordBatch):
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Got a RecordBatch whose schema does not "
 *                                  "match the declared schema of this "
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_batch), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_27 = PyObject_RichCompare(__pyx_t_4, __pyx_v_stream_schema, Py_NE); __Pyx_XGOTREF(__pyx_t_27); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2175, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_27); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2175, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      if (unlikely(__pyx_t_3)) {

        /* "pyarrow/_flight.pyx":2176
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:
 *                 raise ValueError("Got a RecordBatch whose schema does not "             # <<<<<<<<<<<<<<
 *                                  "match the declared schema of this "
 *                                  "GeneratorStream. "
*/
        __pyx_t_4 = NULL;

        /* "pyarrow/_flight.pyx":2179
 *                                  "match the declared schema of this "
 *                                  "GeneratorStream. "
 *                                  f"Got: {batch.schema}\nExpected: {stream_schema}")             # <<<<<<<<<<<<<<
 *             check_flight_status(GetRecordBatchPayload(
 *                 deref(batch.batch),
*/
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_batch), __pyx_mstate_global->__pyx_n_u_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_25 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_25);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_stream_schema, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_26[0] = __pyx_mstate_global->__pyx_kp_u_Got_a_RecordBatch_whose_schema_d;
        __pyx_t_26[1] = __pyx_t_25;
        __pyx_t_26[2] = __pyx_mstate_global->__pyx_kp_u_Expected;
        __pyx_t_26[3] = __pyx_t_1;

        /* "pyarrow/_flight.pyx":2176
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:
 *                 raise ValueError("Got a RecordBatch whose schema does not "             # <<<<<<<<<<<<<<
 *                                  "match the declared schema of this "
 *                                  "GeneratorStream. "
*/
        __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_26, 4, 96 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_25) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_25) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1));
        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13};
          __pyx_t_27 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __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_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
        }
        __Pyx_Raise(__pyx_t_27, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __PYX_ERR(0, 2176, __pyx_L1_error)

        /* "pyarrow/_flight.pyx":2175
 *         elif isinstance(result, RecordBatch):
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Got a RecordBatch whose schema does not "
 *                                  "match the declared schema of this "
*/
      }

      /* "pyarrow/_flight.pyx":2180
 *                                  "GeneratorStream. "
 *                                  f"Got: {batch.schema}\nExpected: {stream_schema}")
 *             check_flight_status(GetRecordBatchPayload(             # <<<<<<<<<<<<<<
 *                 deref(batch.batch),
 *                 stream.c_options,
*/
      __pyx_t_15 = __pyx_f_7pyarrow_7_flight_check_flight_status( arrow::ipc::GetRecordBatchPayload((*__pyx_v_batch->batch), __pyx_v_stream->c_options, (&__pyx_v_payload->ipc_message))); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 2180, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2184
 *                 stream.c_options,
 *                 &payload.ipc_message))
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 payload.app_metadata = pyarrow_unwrap_buffer(
 *                     as_buffer(metadata))
*/
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_metadata); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2184, __pyx_L1_error)
      if (__pyx_t_3) {

        /* "pyarrow/_flight.pyx":2186
 *             if metadata:
 *                 payload.app_metadata = pyarrow_unwrap_buffer(
 *                     as_buffer(metadata))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("GeneratorStream must be initialized with "
*/
        __pyx_t_13 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_as_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2186, __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_13 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_13);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_metadata};
          __pyx_t_27 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2186, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_27);
        }

        /* "pyarrow/_flight.pyx":2185
 *                 &payload.ipc_message))
 *             if metadata:
 *                 payload.app_metadata = pyarrow_unwrap_buffer(             # <<<<<<<<<<<<<<
 *                     as_buffer(metadata))
 *         else:
*/
        __pyx_t_28 = __pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(__pyx_t_27); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2185, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_v_payload->app_metadata = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_28);

        /* "pyarrow/_flight.pyx":2184
 *                 stream.c_options,
 *                 &payload.ipc_message))
 *             if metadata:             # <<<<<<<<<<<<<<
 *                 payload.app_metadata = pyarrow_unwrap_buffer(
 *                     as_buffer(metadata))
*/
      }

      /* "pyarrow/_flight.pyx":2173
 *             # Loop around and try again
 *             continue
 *         elif isinstance(result, RecordBatch):             # <<<<<<<<<<<<<<
 *             batch = <RecordBatch> result
 *             if batch.schema != stream_schema:
*/
      goto __pyx_L43;
    }

    /* "pyarrow/_flight.pyx":2188
 *                     as_buffer(metadata))
 *         else:
 *             raise TypeError("GeneratorStream must be initialized with "             # <<<<<<<<<<<<<<
 *                             "an iterator of FlightDataStream, Table, "
 *                             "RecordBatch, or RecordBatchStreamReader objects, "
*/
    /*else*/ {
      __pyx_t_4 = NULL;

      /* "pyarrow/_flight.pyx":2191
 *                             "an iterator of FlightDataStream, Table, "
 *                             "RecordBatch, or RecordBatchStreamReader objects, "
 *                             f"not {type(result)}.")             # <<<<<<<<<<<<<<
 *         # Don't loop around
 *         return CStatus_OK()
*/
      __pyx_t_13 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_result)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_29[0] = __pyx_mstate_global->__pyx_kp_u_GeneratorStream_must_be_initiali;
      __pyx_t_29[1] = __pyx_t_13;
      __pyx_t_29[2] = __pyx_mstate_global->__pyx_kp_u__8;

      /* "pyarrow/_flight.pyx":2188
 *                     as_buffer(metadata))
 *         else:
 *             raise TypeError("GeneratorStream must be initialized with "             # <<<<<<<<<<<<<<
 *                             "an iterator of FlightDataStream, Table, "
 *                             "RecordBatch, or RecordBatchStreamReader objects, "
*/
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_29, 3, 134 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1};
        __pyx_t_27 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_27);
      }
      __Pyx_Raise(__pyx_t_27, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __PYX_ERR(0, 2188, __pyx_L1_error)
    }
    __pyx_L43:;

    /* "pyarrow/_flight.pyx":2193
 *                             f"not {type(result)}.")
 *         # Don't loop around
 *         return CStatus_OK()             # <<<<<<<<<<<<<<
 *     # Ran out of attempts (the RPC handler kept yielding empty tables/readers)
 *     raise RuntimeError("While getting next payload, ran out of attempts to "
*/
    __pyx_r = arrow::Status::OK();
    goto __pyx_L0;
    __pyx_L4_continue:;
  }

  /* "pyarrow/_flight.pyx":2195
 *         return CStatus_OK()
 *     # Ran out of attempts (the RPC handler kept yielding empty tables/readers)
 *     raise RuntimeError("While getting next payload, ran out of attempts to "             # <<<<<<<<<<<<<<
 *                        "get something to send "
 *                        "(application server implementation error)")
*/
  __pyx_t_1 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_While_getting_next_payload_ran_o};
    __pyx_t_27 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_27);
  }
  __Pyx_Raise(__pyx_t_27, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
  __PYX_ERR(0, 2195, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2111
 * 
 * 
 * cdef CStatus _data_stream_next(void* self, CFlightPayload* payload) except *:             # <<<<<<<<<<<<<<
 *     """Callback for implementing FlightDataStream in Python."""
 *     cdef:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_XDECREF(__pyx_t_27);
  __Pyx_AddTraceback("pyarrow._flight._data_stream_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_stream);
  __Pyx_XDECREF((PyObject *)__pyx_v_stream);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XDECREF(__pyx_v_stream_schema);
  __Pyx_XDECREF(__pyx_v_substream_schema);
  __Pyx_XDECREF((PyObject *)__pyx_v_batch);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2200
 * 
 * 
 * cdef CStatus _list_flights(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                            const CCriteria* c_criteria,
 *                            unique_ptr[CFlightListing]* listing) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__list_flights(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context,  arrow::flight::Criteria const *__pyx_v_c_criteria, std::unique_ptr< arrow::flight::FlightListing>  *__pyx_v_listing) {
  std::vector< arrow::flight::FlightInfo>  __pyx_v_flights;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  arrow::Status __pyx_t_15;
  int __pyx_t_16;
  char const *__pyx_t_17;
  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;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_list_flights", 0);

  /* "pyarrow/_flight.pyx":2207
 *         vector[CFlightInfo] flights
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2208
 * 
 *     try:
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *                                               c_criteria.expression)
 *         for info in result:
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2208, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/_flight.pyx":2209
 *     try:
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)             # <<<<<<<<<<<<<<
 *         for info in result:
 *             if not isinstance(info, FlightInfo):
*/
      __pyx_t_7 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_c_criteria->expression); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2209, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_list_flights, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2208, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_result = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2210
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)
 *         for info in result:             # <<<<<<<<<<<<<<
 *             if not isinstance(info, FlightInfo):
 *                 raise TypeError("FlightServerBase.list_flights must return "
*/
      if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
        __pyx_t_4 = __pyx_v_result; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2210, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2210, __pyx_L3_error)
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2210, __pyx_L3_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_9;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2210, __pyx_L3_error)
              #endif
              if (__pyx_t_9 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9));
            #else
            __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9);
            #endif
            ++__pyx_t_9;
          }
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2210, __pyx_L3_error)
        } else {
          __pyx_t_7 = __pyx_t_10(__pyx_t_4);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2210, __pyx_L3_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_info, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "pyarrow/_flight.pyx":2211
 *                                               c_criteria.expression)
 *         for info in result:
 *             if not isinstance(info, FlightInfo):             # <<<<<<<<<<<<<<
 *                 raise TypeError("FlightServerBase.list_flights must return "
 *                                 f"FlightInfo instances, but got {type(info)}")
*/
        __pyx_t_11 = __Pyx_TypeCheck(__pyx_v_info, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo); 
        __pyx_t_12 = (!__pyx_t_11);
        if (unlikely(__pyx_t_12)) {

          /* "pyarrow/_flight.pyx":2212
 *         for info in result:
 *             if not isinstance(info, FlightInfo):
 *                 raise TypeError("FlightServerBase.list_flights must return "             # <<<<<<<<<<<<<<
 *                                 f"FlightInfo instances, but got {type(info)}")
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
*/
          __pyx_t_6 = NULL;

          /* "pyarrow/_flight.pyx":2213
 *             if not isinstance(info, FlightInfo):
 *                 raise TypeError("FlightServerBase.list_flights must return "
 *                                 f"FlightInfo instances, but got {type(info)}")             # <<<<<<<<<<<<<<
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
 *         listing.reset(new CSimpleFlightListing(flights))
*/
          __pyx_t_5 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_info)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2213, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "pyarrow/_flight.pyx":2212
 *         for info in result:
 *             if not isinstance(info, FlightInfo):
 *                 raise TypeError("FlightServerBase.list_flights must return "             # <<<<<<<<<<<<<<
 *                                 f"FlightInfo instances, but got {type(info)}")
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
*/
          __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_FlightServerBase_list_flights_mu, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2212, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_8 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_13};
            __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2212, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(0, 2212, __pyx_L3_error)

          /* "pyarrow/_flight.pyx":2211
 *                                               c_criteria.expression)
 *         for info in result:
 *             if not isinstance(info, FlightInfo):             # <<<<<<<<<<<<<<
 *                 raise TypeError("FlightServerBase.list_flights must return "
 *                                 f"FlightInfo instances, but got {type(info)}")
*/
        }

        /* "pyarrow/_flight.pyx":2214
 *                 raise TypeError("FlightServerBase.list_flights must return "
 *                                 f"FlightInfo instances, but got {type(info)}")
 *             flights.push_back(deref((<FlightInfo> info).info.get()))             # <<<<<<<<<<<<<<
 *         listing.reset(new CSimpleFlightListing(flights))
 *     except FlightError as flight_error:
*/
        try {
          __pyx_v_flights.push_back((*((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_info)->info.get()));
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 2214, __pyx_L3_error)
        }

        /* "pyarrow/_flight.pyx":2210
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)
 *         for info in result:             # <<<<<<<<<<<<<<
 *             if not isinstance(info, FlightInfo):
 *                 raise TypeError("FlightServerBase.list_flights must return "
*/
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2215
 *                                 f"FlightInfo instances, but got {type(info)}")
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
 *         listing.reset(new CSimpleFlightListing(flights))             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_v_listing->reset(new  arrow::flight::SimpleFlightListing(__pyx_v_flights));

      /* "pyarrow/_flight.pyx":2207
 *         vector[CFlightInfo] flights
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/_flight.pyx":2216
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
 *         listing.reset(new CSimpleFlightListing(flights))
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("pyarrow._flight._list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_13) < 0) __PYX_ERR(0, 2216, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_flight_error = __pyx_t_7;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2217
 *         listing.reset(new CSimpleFlightListing(flights))
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_15 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2217, __pyx_L18_error)
        __pyx_r = __pyx_t_15;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L17_return;
      }

      /* "pyarrow/_flight.pyx":2216
 *             flights.push_back(deref((<FlightInfo> info).info.get()))
 *         listing.reset(new CSimpleFlightListing(flights))
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ( unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          __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_XGOTREF(__pyx_t_23);
          __pyx_t_14 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
          goto __pyx_L5_except_error;
        }
        __pyx_L17_return: {
          __pyx_t_15 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_15;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2207
 *         vector[CFlightInfo] flights
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_flights(ServerCallContext.wrap(context),
 *                                               c_criteria.expression)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2218
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2200
 * 
 * 
 * cdef CStatus _list_flights(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                            const CCriteria* c_criteria,
 *                            unique_ptr[CFlightListing]* listing) except *:
*/

  /* 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_13);
  __Pyx_AddTraceback("pyarrow._flight._list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2221
 * 
 * 
 * cdef CStatus _get_flight_info(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                               CFlightDescriptor c_descriptor,
 *                               unique_ptr[CFlightInfo]* info) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__get_flight_info(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context,  arrow::flight::FlightDescriptor __pyx_v_c_descriptor, std::unique_ptr< arrow::flight::FlightInfo>  *__pyx_v_info) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_py_descriptor = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_flight_info", 0);

  /* "pyarrow/_flight.pyx":2227
 *     cdef:
 *         FlightDescriptor py_descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *     py_descriptor.descriptor = c_descriptor
 *     try:
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2227, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_py_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2228
 *         FlightDescriptor py_descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor             # <<<<<<<<<<<<<<
 *     try:
 *         result = (<object> self).get_flight_info(
*/
  __pyx_v_py_descriptor->descriptor = __pyx_v_c_descriptor;

  /* "pyarrow/_flight.pyx":2229
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).get_flight_info(
 *             ServerCallContext.wrap(context),
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2230
 *     py_descriptor.descriptor = c_descriptor
 *     try:
 *         result = (<object> self).get_flight_info(             # <<<<<<<<<<<<<<
 *             ServerCallContext.wrap(context),
 *             py_descriptor)
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);

      /* "pyarrow/_flight.pyx":2231
 *     try:
 *         result = (<object> self).get_flight_info(
 *             ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *             py_descriptor)
 *     except FlightError as flight_error:
*/
      __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2231, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/_flight.pyx":2232
 *         result = (<object> self).get_flight_info(
 *             ServerCallContext.wrap(context),
 *             py_descriptor)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_v_py_descriptor)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_flight_info, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__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_1)) __PYX_ERR(0, 2230, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2229
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).get_flight_info(
 *             ServerCallContext.wrap(context),
*/
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/_flight.pyx":2233
 *             ServerCallContext.wrap(context),
 *             py_descriptor)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow._flight._get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 2233, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_flight_error = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2234
 *             py_descriptor)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     if not isinstance(result, FlightInfo):
 *         raise TypeError("FlightServerBase.get_flight_info must return "
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2233
 *             ServerCallContext.wrap(context),
 *             py_descriptor)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2229
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).get_flight_info(
 *             ServerCallContext.wrap(context),
*/
    __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_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;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2235
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.get_flight_info must return "
 *                         f"a FlightInfo instance, but got {type(result)}")
*/
  __pyx_t_18 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo); 
  __pyx_t_19 = (!__pyx_t_18);
  if (unlikely(__pyx_t_19)) {

    /* "pyarrow/_flight.pyx":2236
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):
 *         raise TypeError("FlightServerBase.get_flight_info must return "             # <<<<<<<<<<<<<<
 *                         f"a FlightInfo instance, but got {type(result)}")
 *     info.reset(new CFlightInfo(deref((<FlightInfo> result).info.get())))
*/
    __pyx_t_6 = NULL;

    /* "pyarrow/_flight.pyx":2237
 *     if not isinstance(result, FlightInfo):
 *         raise TypeError("FlightServerBase.get_flight_info must return "
 *                         f"a FlightInfo instance, but got {type(result)}")             # <<<<<<<<<<<<<<
 *     info.reset(new CFlightInfo(deref((<FlightInfo> result).info.get())))
 *     return CStatus_OK()
*/
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_result)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/_flight.pyx":2236
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):
 *         raise TypeError("FlightServerBase.get_flight_info must return "             # <<<<<<<<<<<<<<
 *                         f"a FlightInfo instance, but got {type(result)}")
 *     info.reset(new CFlightInfo(deref((<FlightInfo> result).info.get())))
*/
    __pyx_t_20 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_FlightServerBase_get_flight_info, __pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_20};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(0, 2236, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2235
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightInfo):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.get_flight_info must return "
 *                         f"a FlightInfo instance, but got {type(result)}")
*/
  }

  /* "pyarrow/_flight.pyx":2238
 *         raise TypeError("FlightServerBase.get_flight_info must return "
 *                         f"a FlightInfo instance, but got {type(result)}")
 *     info.reset(new CFlightInfo(deref((<FlightInfo> result).info.get())))             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
  __pyx_v_info->reset(new  arrow::flight::FlightInfo((*((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)__pyx_v_result)->info.get())));

  /* "pyarrow/_flight.pyx":2239
 *                         f"a FlightInfo instance, but got {type(result)}")
 *     info.reset(new CFlightInfo(deref((<FlightInfo> result).info.get())))
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * cdef CStatus _get_schema(void* self, const CServerCallContext& context,
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2221
 * 
 * 
 * cdef CStatus _get_flight_info(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                               CFlightDescriptor c_descriptor,
 *                               unique_ptr[CFlightInfo]* info) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("pyarrow._flight._get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_descriptor);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2241
 *     return CStatus_OK()
 * 
 * cdef CStatus _get_schema(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                          CFlightDescriptor c_descriptor,
 *                          unique_ptr[CSchemaResult]* info) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__get_schema(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context,  arrow::flight::FlightDescriptor __pyx_v_c_descriptor, std::unique_ptr< arrow::flight::SchemaResult>  *__pyx_v_info) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_py_descriptor = 0;
  PyObject *__pyx_v_result = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_schema", 0);

  /* "pyarrow/_flight.pyx":2247
 *     cdef:
 *         FlightDescriptor py_descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 *     py_descriptor.descriptor = c_descriptor
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_py_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2248
 *         FlightDescriptor py_descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor             # <<<<<<<<<<<<<<
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),
 *                                         py_descriptor)
*/
  __pyx_v_py_descriptor->descriptor = __pyx_v_c_descriptor;

  /* "pyarrow/_flight.pyx":2249
 *             FlightDescriptor.__new__(FlightDescriptor)
 *     py_descriptor.descriptor = c_descriptor
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *                                         py_descriptor)
 *     if not isinstance(result, SchemaResult):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/_flight.pyx":2250
 *     py_descriptor.descriptor = c_descriptor
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),
 *                                         py_descriptor)             # <<<<<<<<<<<<<<
 *     if not isinstance(result, SchemaResult):
 *         raise TypeError("FlightServerBase.get_schema_info must return "
*/
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_py_descriptor)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_schema, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__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, 2249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2251
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),
 *                                         py_descriptor)
 *     if not isinstance(result, SchemaResult):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.get_schema_info must return "
 *                         f"a SchemaResult instance, but got {type(result)}")
*/
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult); 
  __pyx_t_6 = (!__pyx_t_5);
  if (unlikely(__pyx_t_6)) {

    /* "pyarrow/_flight.pyx":2252
 *                                         py_descriptor)
 *     if not isinstance(result, SchemaResult):
 *         raise TypeError("FlightServerBase.get_schema_info must return "             # <<<<<<<<<<<<<<
 *                         f"a SchemaResult instance, but got {type(result)}")
 *     info.reset(new CSchemaResult(deref((<SchemaResult> result).result.get())))
*/
    __pyx_t_3 = NULL;

    /* "pyarrow/_flight.pyx":2253
 *     if not isinstance(result, SchemaResult):
 *         raise TypeError("FlightServerBase.get_schema_info must return "
 *                         f"a SchemaResult instance, but got {type(result)}")             # <<<<<<<<<<<<<<
 *     info.reset(new CSchemaResult(deref((<SchemaResult> result).result.get())))
 *     return CStatus_OK()
*/
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_result)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "pyarrow/_flight.pyx":2252
 *                                         py_descriptor)
 *     if not isinstance(result, SchemaResult):
 *         raise TypeError("FlightServerBase.get_schema_info must return "             # <<<<<<<<<<<<<<
 *                         f"a SchemaResult instance, but got {type(result)}")
 *     info.reset(new CSchemaResult(deref((<SchemaResult> result).result.get())))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_FlightServerBase_get_schema_info, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2252, __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, 2252, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2251
 *     result = (<object> self).get_schema(ServerCallContext.wrap(context),
 *                                         py_descriptor)
 *     if not isinstance(result, SchemaResult):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.get_schema_info must return "
 *                         f"a SchemaResult instance, but got {type(result)}")
*/
  }

  /* "pyarrow/_flight.pyx":2254
 *         raise TypeError("FlightServerBase.get_schema_info must return "
 *                         f"a SchemaResult instance, but got {type(result)}")
 *     info.reset(new CSchemaResult(deref((<SchemaResult> result).result.get())))             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
  __pyx_v_info->reset(new  arrow::flight::SchemaResult((*((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)__pyx_v_result)->result.get())));

  /* "pyarrow/_flight.pyx":2255
 *                         f"a SchemaResult instance, but got {type(result)}")
 *     info.reset(new CSchemaResult(deref((<SchemaResult> result).result.get())))
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * cdef CStatus _do_put(void* self, const CServerCallContext& context,
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2241
 *     return CStatus_OK()
 * 
 * cdef CStatus _get_schema(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                          CFlightDescriptor c_descriptor,
 *                          unique_ptr[CSchemaResult]* info) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._flight._get_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_descriptor);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2257
 *     return CStatus_OK()
 * 
 * cdef CStatus _do_put(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                      unique_ptr[CFlightMessageReader] reader,
 *                      unique_ptr[CFlightMetadataWriter] writer) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__do_put(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context, std::unique_ptr< arrow::flight::FlightMessageReader>  __pyx_v_reader, std::unique_ptr< arrow::flight::FlightMetadataWriter>  __pyx_v_writer) {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_py_reader = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_py_writer = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_put", 0);

  /* "pyarrow/_flight.pyx":2262
 *     """Callback for implementing Flight servers in Python."""
 *     cdef:
 *         MetadataRecordBatchReader py_reader = MetadataRecordBatchReader()             # <<<<<<<<<<<<<<
 *         FlightMetadataWriter py_writer = FlightMetadataWriter()
 *         FlightDescriptor descriptor = \
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2262, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_reader = ((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2263
 *     cdef:
 *         MetadataRecordBatchReader py_reader = MetadataRecordBatchReader()
 *         FlightMetadataWriter py_writer = FlightMetadataWriter()             # <<<<<<<<<<<<<<
 *         FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2263, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_writer = ((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2265
 *         FlightMetadataWriter py_writer = FlightMetadataWriter()
 *         FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 * 
 *     descriptor.descriptor = reader.get().descriptor()
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2267
 *             FlightDescriptor.__new__(FlightDescriptor)
 * 
 *     descriptor.descriptor = reader.get().descriptor()             # <<<<<<<<<<<<<<
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
*/
  __pyx_v_descriptor->descriptor = __pyx_v_reader.get()->descriptor();

  /* "pyarrow/_flight.pyx":2268
 * 
 *     descriptor.descriptor = reader.get().descriptor()
 *     py_reader.reader.reset(reader.release())             # <<<<<<<<<<<<<<
 *     py_writer.writer.reset(writer.release())
 *     try:
*/
  __pyx_v_py_reader->__pyx_base.reader.reset(__pyx_v_reader.release());

  /* "pyarrow/_flight.pyx":2269
 *     descriptor.descriptor = reader.get().descriptor()
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())             # <<<<<<<<<<<<<<
 *     try:
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
*/
  __pyx_v_py_writer->writer.reset(__pyx_v_writer.release());

  /* "pyarrow/_flight.pyx":2270
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
 *                                py_reader, py_writer)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "pyarrow/_flight.pyx":2271
 *     py_writer.writer.reset(writer.release())
 *     try:
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,             # <<<<<<<<<<<<<<
 *                                py_reader, py_writer)
 *         return CStatus_OK()
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2271, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/_flight.pyx":2272
 *     try:
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
 *                                py_reader, py_writer)             # <<<<<<<<<<<<<<
 *         return CStatus_OK()
 *     except FlightError as flight_error:
*/
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_v_descriptor), ((PyObject *)__pyx_v_py_reader), ((PyObject *)__pyx_v_py_writer)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_do_put, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2273
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
 *                                py_reader, py_writer)
 *         return CStatus_OK()             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_r = arrow::Status::OK();
      goto __pyx_L7_try_return;

      /* "pyarrow/_flight.pyx":2270
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
 *                                py_reader, py_writer)
*/
    }
    __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_7); __pyx_t_7 = 0;

    /* "pyarrow/_flight.pyx":2274
 *                                py_reader, py_writer)
 *         return CStatus_OK()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow._flight._do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(0, 2274, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_flight_error = __pyx_t_7;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2275
 *         return CStatus_OK()
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2275, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2274
 *                                py_reader, py_writer)
 *         return CStatus_OK()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2270
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_put(ServerCallContext.wrap(context), descriptor,
 *                                py_reader, py_writer)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
  }

  /* "pyarrow/_flight.pyx":2257
 *     return CStatus_OK()
 * 
 * cdef CStatus _do_put(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                      unique_ptr[CFlightMessageReader] reader,
 *                      unique_ptr[CFlightMetadataWriter] writer) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._flight._do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_reader);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_writer);
  __Pyx_XDECREF((PyObject *)__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2278
 * 
 * 
 * cdef CStatus _do_get(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                      CTicket ticket,
 *                      unique_ptr[CFlightDataStream]* stream) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__do_get(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context,  arrow::flight::Ticket __pyx_v_ticket, std::unique_ptr< arrow::flight::FlightDataStream>  *__pyx_v_stream) {
  std::unique_ptr< arrow::flight::FlightDataStream>  __pyx_v_data_stream;
  struct __pyx_obj_7pyarrow_7_flight_Ticket *__pyx_v_py_ticket = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_t_19;
   arrow::flight::FlightDataStream *__pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_get", 0);

  /* "pyarrow/_flight.pyx":2285
 *         unique_ptr[CFlightDataStream] data_stream
 * 
 *     py_ticket = Ticket(ticket.ticket)             # <<<<<<<<<<<<<<
 *     try:
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_ticket.ticket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __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, 2285, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_ticket = ((struct __pyx_obj_7pyarrow_7_flight_Ticket *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2286
 * 
 *     py_ticket = Ticket(ticket.ticket)
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "pyarrow/_flight.pyx":2287
 *     py_ticket = Ticket(ticket.ticket)
 *     try:
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *                                         py_ticket)
 *     except FlightError as flight_error:
*/
      __pyx_t_3 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2287, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "pyarrow/_flight.pyx":2288
 *     try:
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_py_ticket)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_do_get, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2286
 * 
 *     py_ticket = Ticket(ticket.ticket)
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)
*/
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L8_try_end;
    __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;

    /* "pyarrow/_flight.pyx":2289
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightDataStream):
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow._flight._do_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 2289, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_flight_error = __pyx_t_2;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2290
 *                                         py_ticket)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     if not isinstance(result, FlightDataStream):
 *         raise TypeError("FlightServerBase.do_get must return "
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2290, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2289
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightDataStream):
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2286
 * 
 *     py_ticket = Ticket(ticket.ticket)
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).do_get(ServerCallContext.wrap(context),
 *                                         py_ticket)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2291
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightDataStream):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.do_get must return "
 *                         "a FlightDataStream")
*/
  __pyx_t_18 = __Pyx_TypeCheck(__pyx_v_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream); 
  __pyx_t_19 = (!__pyx_t_18);
  if (unlikely(__pyx_t_19)) {

    /* "pyarrow/_flight.pyx":2292
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightDataStream):
 *         raise TypeError("FlightServerBase.do_get must return "             # <<<<<<<<<<<<<<
 *                         "a FlightDataStream")
 *     data_stream = unique_ptr[CFlightDataStream](
*/
    __pyx_t_2 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_FlightServerBase_do_get_must_ret};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2292, __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, 2292, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2291
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     if not isinstance(result, FlightDataStream):             # <<<<<<<<<<<<<<
 *         raise TypeError("FlightServerBase.do_get must return "
 *                         "a FlightDataStream")
*/
  }

  /* "pyarrow/_flight.pyx":2295
 *                         "a FlightDataStream")
 *     data_stream = unique_ptr[CFlightDataStream](
 *         (<FlightDataStream> result).to_stream())             # <<<<<<<<<<<<<<
 *     stream[0] = unique_ptr[CFlightDataStream](
 *         new CPyFlightDataStream(result, move(data_stream)))
*/
  __pyx_t_20 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream *)((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v_result)->__pyx_vtab)->to_stream(((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v_result)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2295, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2294
 *         raise TypeError("FlightServerBase.do_get must return "
 *                         "a FlightDataStream")
 *     data_stream = unique_ptr[CFlightDataStream](             # <<<<<<<<<<<<<<
 *         (<FlightDataStream> result).to_stream())
 *     stream[0] = unique_ptr[CFlightDataStream](
*/
  __pyx_v_data_stream = std::unique_ptr< arrow::flight::FlightDataStream> (__pyx_t_20);

  /* "pyarrow/_flight.pyx":2296
 *     data_stream = unique_ptr[CFlightDataStream](
 *         (<FlightDataStream> result).to_stream())
 *     stream[0] = unique_ptr[CFlightDataStream](             # <<<<<<<<<<<<<<
 *         new CPyFlightDataStream(result, move(data_stream)))
 *     return CStatus_OK()
*/
  (__pyx_v_stream[0]) = std::unique_ptr< arrow::flight::FlightDataStream> (new  arrow::py::flight::PyFlightDataStream(__pyx_v_result, cython_std::move<std::unique_ptr< arrow::flight::FlightDataStream> >(__pyx_v_data_stream)));

  /* "pyarrow/_flight.pyx":2298
 *     stream[0] = unique_ptr[CFlightDataStream](
 *         new CPyFlightDataStream(result, move(data_stream)))
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2278
 * 
 * 
 * cdef CStatus _do_get(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                      CTicket ticket,
 *                      unique_ptr[CFlightDataStream]* stream) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight._do_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_ticket);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2301
 * 
 * 
 * cdef CStatus _do_exchange(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                           unique_ptr[CFlightMessageReader] reader,
 *                           unique_ptr[CFlightMessageWriter] writer) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__do_exchange(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context, std::unique_ptr< arrow::flight::FlightMessageReader>  __pyx_v_reader, std::unique_ptr< arrow::flight::FlightMessageWriter>  __pyx_v_writer) {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_py_reader = 0;
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *__pyx_v_py_writer = 0;
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_exchange", 0);

  /* "pyarrow/_flight.pyx":2306
 *     """Callback for implementing Flight servers in Python."""
 *     cdef:
 *         MetadataRecordBatchReader py_reader = MetadataRecordBatchReader()             # <<<<<<<<<<<<<<
 *         MetadataRecordBatchWriter py_writer = MetadataRecordBatchWriter()
 *         FlightDescriptor descriptor = \
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2306, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_reader = ((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2307
 *     cdef:
 *         MetadataRecordBatchReader py_reader = MetadataRecordBatchReader()
 *         MetadataRecordBatchWriter py_writer = MetadataRecordBatchWriter()             # <<<<<<<<<<<<<<
 *         FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2307, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_writer = ((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2309
 *         MetadataRecordBatchWriter py_writer = MetadataRecordBatchWriter()
 *         FlightDescriptor descriptor = \
 *             FlightDescriptor.__new__(FlightDescriptor)             # <<<<<<<<<<<<<<
 * 
 *     descriptor.descriptor = reader.get().descriptor()
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2309, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_descriptor = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2311
 *             FlightDescriptor.__new__(FlightDescriptor)
 * 
 *     descriptor.descriptor = reader.get().descriptor()             # <<<<<<<<<<<<<<
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
*/
  __pyx_v_descriptor->descriptor = __pyx_v_reader.get()->descriptor();

  /* "pyarrow/_flight.pyx":2312
 * 
 *     descriptor.descriptor = reader.get().descriptor()
 *     py_reader.reader.reset(reader.release())             # <<<<<<<<<<<<<<
 *     py_writer.writer.reset(writer.release())
 *     try:
*/
  __pyx_v_py_reader->__pyx_base.reader.reset(__pyx_v_reader.release());

  /* "pyarrow/_flight.pyx":2313
 *     descriptor.descriptor = reader.get().descriptor()
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())             # <<<<<<<<<<<<<<
 *     try:
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
*/
  __pyx_v_py_writer->__pyx_base.writer.reset(__pyx_v_writer.release());

  /* "pyarrow/_flight.pyx":2314
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
 *                                     descriptor, py_reader, py_writer)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

      /* "pyarrow/_flight.pyx":2315
 *     py_writer.writer.reset(writer.release())
 *     try:
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *                                     descriptor, py_reader, py_writer)
 *         return CStatus_OK()
*/
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2315, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/_flight.pyx":2316
 *     try:
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
 *                                     descriptor, py_reader, py_writer)             # <<<<<<<<<<<<<<
 *         return CStatus_OK()
 *     except FlightError as flight_error:
*/
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_v_descriptor), ((PyObject *)__pyx_v_py_reader), ((PyObject *)__pyx_v_py_writer)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_do_exchange, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2315, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2317
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
 *                                     descriptor, py_reader, py_writer)
 *         return CStatus_OK()             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_r = arrow::Status::OK();
      goto __pyx_L7_try_return;

      /* "pyarrow/_flight.pyx":2314
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
 *                                     descriptor, py_reader, py_writer)
*/
    }
    __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_7); __pyx_t_7 = 0;

    /* "pyarrow/_flight.pyx":2318
 *                                     descriptor, py_reader, py_writer)
 *         return CStatus_OK()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pyarrow._flight._do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(0, 2318, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_flight_error = __pyx_t_7;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2319
 *         return CStatus_OK()
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2319, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2318
 *                                     descriptor, py_reader, py_writer)
 *         return CStatus_OK()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_8 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2314
 *     py_reader.reader.reset(reader.release())
 *     py_writer.writer.reset(writer.release())
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).do_exchange(ServerCallContext.wrap(context),
 *                                     descriptor, py_reader, py_writer)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    goto __pyx_L0;
  }

  /* "pyarrow/_flight.pyx":2301
 * 
 * 
 * cdef CStatus _do_exchange(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                           unique_ptr[CFlightMessageReader] reader,
 *                           unique_ptr[CFlightMessageWriter] writer) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._flight._do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_reader);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_writer);
  __Pyx_XDECREF((PyObject *)__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2322
 * 
 * 
 * cdef CStatus _do_action_result_next(             # <<<<<<<<<<<<<<
 *     void* self,
 *     unique_ptr[CFlightResult]* result
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__do_action_result_next(void *__pyx_v_self, std::unique_ptr< arrow::flight::Result>  *__pyx_v_result) {
   arrow::flight::Result *__pyx_v_c_result;
  PyObject *__pyx_v_action_result = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  arrow::Status __pyx_t_11;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_action_result_next", 0);

  /* "pyarrow/_flight.pyx":2330
 *         CFlightResult* c_result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2331
 * 
 *     try:
 *         action_result = next(<object> self)             # <<<<<<<<<<<<<<
 *         if not isinstance(action_result, Result):
 *             action_result = Result(action_result)
*/
      __pyx_t_4 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2331, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_action_result = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2332
 *     try:
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):             # <<<<<<<<<<<<<<
 *             action_result = Result(action_result)
 *         c_result = (<Result> action_result).result.get()
*/
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_action_result, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result); 
      __pyx_t_6 = (!__pyx_t_5);
      if (__pyx_t_6) {

        /* "pyarrow/_flight.pyx":2333
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):
 *             action_result = Result(action_result)             # <<<<<<<<<<<<<<
 *         c_result = (<Result> action_result).result.get()
 *         result.reset(new CFlightResult(deref(c_result)))
*/
        __pyx_t_7 = NULL;
        __pyx_t_8 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_action_result};
          __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2333, __pyx_L3_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_4);
        }
        __Pyx_DECREF_SET(__pyx_v_action_result, ((PyObject *)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "pyarrow/_flight.pyx":2332
 *     try:
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):             # <<<<<<<<<<<<<<
 *             action_result = Result(action_result)
 *         c_result = (<Result> action_result).result.get()
*/
      }

      /* "pyarrow/_flight.pyx":2334
 *         if not isinstance(action_result, Result):
 *             action_result = Result(action_result)
 *         c_result = (<Result> action_result).result.get()             # <<<<<<<<<<<<<<
 *         result.reset(new CFlightResult(deref(c_result)))
 *     except StopIteration:
*/
      __pyx_v_c_result = ((struct __pyx_obj_7pyarrow_7_flight_Result *)__pyx_v_action_result)->result.get();

      /* "pyarrow/_flight.pyx":2335
 *             action_result = Result(action_result)
 *         c_result = (<Result> action_result).result.get()
 *         result.reset(new CFlightResult(deref(c_result)))             # <<<<<<<<<<<<<<
 *     except StopIteration:
 *         result.reset(nullptr)
*/
      __pyx_v_result->reset(new  arrow::flight::Result((*__pyx_v_c_result)));

      /* "pyarrow/_flight.pyx":2330
 *         CFlightResult* c_result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/_flight.pyx":2336
 *         c_result = (<Result> action_result).result.get()
 *         result.reset(new CFlightResult(deref(c_result)))
 *     except StopIteration:             # <<<<<<<<<<<<<<
 *         result.reset(nullptr)
 *     except FlightError as flight_error:
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_StopIteration))));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow._flight._do_action_result_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 2336, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_10);

      /* "pyarrow/_flight.pyx":2337
 *         result.reset(new CFlightResult(deref(c_result)))
 *     except StopIteration:
 *         result.reset(nullptr)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_v_result->reset(nullptr);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }

    /* "pyarrow/_flight.pyx":2338
 *     except StopIteration:
 *         result.reset(nullptr)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow._flight._do_action_result_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 2338, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_flight_error = __pyx_t_7;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2339
 *         result.reset(nullptr)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_11 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2339, __pyx_L17_error)
        __pyx_r = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L16_return;
      }

      /* "pyarrow/_flight.pyx":2338
 *     except StopIteration:
 *         result.reset(nullptr)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L17_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          if ( unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_9 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
          __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
          goto __pyx_L5_except_error;
        }
        __pyx_L16_return: {
          __pyx_t_11 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_11;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2330
 *         CFlightResult* c_result
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         action_result = next(<object> self)
 *         if not isinstance(action_result, Result):
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2340
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2322
 * 
 * 
 * cdef CStatus _do_action_result_next(             # <<<<<<<<<<<<<<
 *     void* self,
 *     unique_ptr[CFlightResult]* result
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow._flight._do_action_result_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_action_result);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2343
 * 
 * 
 * cdef CStatus _do_action(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                         const CAction& action,
 *                         unique_ptr[CResultStream]* result) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__do_action(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context,  arrow::flight::Action const &__pyx_v_action, std::unique_ptr< arrow::flight::ResultStream>  *__pyx_v_result) {
  std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_result_next>  __pyx_v_ptr;
  struct __pyx_obj_7pyarrow_7_flight_Action *__pyx_v_py_action = NULL;
  PyObject *__pyx_v_responses = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  arrow::Status __pyx_t_10;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_action", 0);

  /* "pyarrow/_flight.pyx":2348
 *     """Callback for implementing Flight servers in Python."""
 *     cdef:
 *         function[cb_result_next] ptr = &_do_action_result_next             # <<<<<<<<<<<<<<
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))
 *     try:
*/
  __pyx_v_ptr = (&__pyx_f_7pyarrow_7_flight__do_action_result_next);

  /* "pyarrow/_flight.pyx":2349
 *     cdef:
 *         function[cb_result_next] ptr = &_do_action_result_next
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))             # <<<<<<<<<<<<<<
 *     try:
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_action.type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_action.body); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_callargs+__pyx_t_5, (3-__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2349, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_py_action = ((struct __pyx_obj_7pyarrow_7_flight_Action *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2350
 *         function[cb_result_next] ptr = &_do_action_result_next
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))
 *     try:             # <<<<<<<<<<<<<<
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "pyarrow/_flight.pyx":2351
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))
 *     try:
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),             # <<<<<<<<<<<<<<
 *                                               py_action)
 *     except FlightError as flight_error:
*/
      __pyx_t_4 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2351, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/_flight.pyx":2352
 *     try:
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_py_action)};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_do_action, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__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_1)) __PYX_ERR(0, 2351, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_responses = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2350
 *         function[cb_result_next] ptr = &_do_action_result_next
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))
 *     try:             # <<<<<<<<<<<<<<
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)
*/
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_try_end;
    __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;

    /* "pyarrow/_flight.pyx":2353
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     # Let the application return an iterator or anything convertible
*/
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pyarrow._flight._do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 2353, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_flight_error = __pyx_t_3;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2354
 *                                               py_action)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     # Let the application return an iterator or anything convertible
 *     # into one
*/
        __pyx_t_10 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2354, __pyx_L14_error)
        __pyx_r = __pyx_t_10;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2353
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     # Let the application return an iterator or anything convertible
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          if ( unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __pyx_t_9 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_10 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_10;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2350
 *         function[cb_result_next] ptr = &_do_action_result_next
 *     py_action = Action(action.type, pyarrow_wrap_buffer(action.body))
 *     try:             # <<<<<<<<<<<<<<
 *         responses = (<object> self).do_action(ServerCallContext.wrap(context),
 *                                               py_action)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2357
 *     # Let the application return an iterator or anything convertible
 *     # into one
 *     if responses is None:             # <<<<<<<<<<<<<<
 *         # Server didn't return anything
 *         responses = []
*/
  __pyx_t_19 = (__pyx_v_responses == Py_None);
  if (__pyx_t_19) {

    /* "pyarrow/_flight.pyx":2359
 *     if responses is None:
 *         # Server didn't return anything
 *         responses = []             # <<<<<<<<<<<<<<
 *     result.reset(new CPyFlightResultStream(iter(responses), ptr))
 *     return CStatus_OK()
*/
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_responses, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":2357
 *     # Let the application return an iterator or anything convertible
 *     # into one
 *     if responses is None:             # <<<<<<<<<<<<<<
 *         # Server didn't return anything
 *         responses = []
*/
  }

  /* "pyarrow/_flight.pyx":2360
 *         # Server didn't return anything
 *         responses = []
 *     result.reset(new CPyFlightResultStream(iter(responses), ptr))             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
  __pyx_t_4 = PyObject_GetIter(__pyx_v_responses); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_result->reset(new  arrow::py::flight::PyFlightResultStream(__pyx_t_4, __pyx_v_ptr));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/_flight.pyx":2361
 *         responses = []
 *     result.reset(new CPyFlightResultStream(iter(responses), ptr))
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2343
 * 
 * 
 * cdef CStatus _do_action(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                         const CAction& action,
 *                         unique_ptr[CResultStream]* result) except *:
*/

  /* 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("pyarrow._flight._do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_py_action);
  __Pyx_XDECREF(__pyx_v_responses);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2364
 * 
 * 
 * cdef CStatus _list_actions(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                            vector[CActionType]* actions) except *:
 *     """Callback for implementing Flight servers in Python."""
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__list_actions(void *__pyx_v_self,  arrow::flight::ServerCallContext const &__pyx_v_context, std::vector< arrow::flight::ActionType>  *__pyx_v_actions) {
   arrow::flight::ActionType __pyx_v_action_type;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_action = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  std::string __pyx_t_14;
  int __pyx_t_15;
  arrow::Status __pyx_t_16;
  int __pyx_t_17;
  char const *__pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_list_actions", 0);

  /* "pyarrow/_flight.pyx":2370
 *         CActionType action_type
 *     # Method should return a list of ActionTypes or similar tuple
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2371
 *     # Method should return a list of ActionTypes or similar tuple
 *     try:
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))             # <<<<<<<<<<<<<<
 *         for action in result:
 *             if not isinstance(action, tuple):
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = ((PyObject *)__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap(__pyx_v_context)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2371, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_list_actions, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__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_4)) __PYX_ERR(0, 2371, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_result = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2372
 *     try:
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:             # <<<<<<<<<<<<<<
 *             if not isinstance(action, tuple):
 *                 raise TypeError(
*/
      if (likely(PyList_CheckExact(__pyx_v_result)) || PyTuple_CheckExact(__pyx_v_result)) {
        __pyx_t_4 = __pyx_v_result; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2372, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2372, __pyx_L3_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2372, __pyx_L3_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_8;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2372, __pyx_L3_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8));
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8);
            #endif
            ++__pyx_t_8;
          }
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2372, __pyx_L3_error)
        } else {
          __pyx_t_6 = __pyx_t_9(__pyx_t_4);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2372, __pyx_L3_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_v_action, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "pyarrow/_flight.pyx":2373
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:
 *             if not isinstance(action, tuple):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     "Results of list_actions must be ActionType or tuple")
*/
        __pyx_t_10 = PyTuple_Check(__pyx_v_action); 
        __pyx_t_11 = (!__pyx_t_10);
        if (unlikely(__pyx_t_11)) {

          /* "pyarrow/_flight.pyx":2374
 *         for action in result:
 *             if not isinstance(action, tuple):
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     "Results of list_actions must be ActionType or tuple")
 *             action_type.type = tobytes(action[0])
*/
          __pyx_t_5 = NULL;
          __pyx_t_7 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Results_of_list_actions_must_be};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2374, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(0, 2374, __pyx_L3_error)

          /* "pyarrow/_flight.pyx":2373
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:
 *             if not isinstance(action, tuple):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     "Results of list_actions must be ActionType or tuple")
*/
        }

        /* "pyarrow/_flight.pyx":2376
 *                 raise TypeError(
 *                     "Results of list_actions must be ActionType or tuple")
 *             action_type.type = tobytes(action[0])             # <<<<<<<<<<<<<<
 *             action_type.description = tobytes(action[1])
 *             actions.push_back(action_type)
*/
        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2376, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_action, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2376, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_13};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2376, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2376, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_action_type.type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

        /* "pyarrow/_flight.pyx":2377
 *                     "Results of list_actions must be ActionType or tuple")
 *             action_type.type = tobytes(action[0])
 *             action_type.description = tobytes(action[1])             # <<<<<<<<<<<<<<
 *             actions.push_back(action_type)
 *     except FlightError as flight_error:
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2377, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_action, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2377, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_5};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2377, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_14 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2377, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_action_type.description = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_14);

        /* "pyarrow/_flight.pyx":2378
 *             action_type.type = tobytes(action[0])
 *             action_type.description = tobytes(action[1])
 *             actions.push_back(action_type)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
        try {
          __pyx_v_actions->push_back(__pyx_v_action_type);
        } catch(...) {
          __Pyx_CppExn2PyErr();
          __PYX_ERR(0, 2378, __pyx_L3_error)
        }

        /* "pyarrow/_flight.pyx":2372
 *     try:
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:             # <<<<<<<<<<<<<<
 *             if not isinstance(action, tuple):
 *                 raise TypeError(
*/
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2370
 *         CActionType action_type
 *     # Method should return a list of ActionTypes or similar tuple
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/_flight.pyx":2379
 *             action_type.description = tobytes(action[1])
 *             actions.push_back(action_type)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_15) {
      __Pyx_AddTraceback("pyarrow._flight._list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_13) < 0) __PYX_ERR(0, 2379, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_flight_error = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2380
 *             actions.push_back(action_type)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_16 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L18_error)
        __pyx_r = __pyx_t_16;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L17_return;
      }

      /* "pyarrow/_flight.pyx":2379
 *             action_type.description = tobytes(action[1])
 *             actions.push_back(action_type)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L18_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
          if ( unlikely(__Pyx_GetException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __Pyx_XGOTREF(__pyx_t_24);
          __pyx_t_15 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_23, __pyx_t_24);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ErrRestore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0;
          __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
          goto __pyx_L5_except_error;
        }
        __pyx_L17_return: {
          __pyx_t_16 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_16;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2370
 *         CActionType action_type
 *     # Method should return a list of ActionTypes or similar tuple
 *     try:             # <<<<<<<<<<<<<<
 *         result = (<object> self).list_actions(ServerCallContext.wrap(context))
 *         for action in result:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2381
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2364
 * 
 * 
 * cdef CStatus _list_actions(void* self, const CServerCallContext& context,             # <<<<<<<<<<<<<<
 *                            vector[CActionType]* actions) except *:
 *     """Callback for implementing Flight servers in Python."""
*/

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow._flight._list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_action);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2384
 * 
 * 
 * cdef CStatus _server_authenticate(void* self, CServerAuthSender* outgoing,             # <<<<<<<<<<<<<<
 *                                   CServerAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__server_authenticate(void *__pyx_v_self,  arrow::flight::ServerAuthSender *__pyx_v_outgoing,  arrow::flight::ServerAuthReader *__pyx_v_incoming) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *__pyx_v_sender = NULL;
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *__pyx_v_reader = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  char const *__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_server_authenticate", 0);

  /* "pyarrow/_flight.pyx":2387
 *                                   CServerAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
 *     sender = ServerAuthSender.wrap(outgoing)             # <<<<<<<<<<<<<<
 *     reader = ServerAuthReader.wrap(incoming)
 *     try:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_7_flight_16ServerAuthSender_wrap(__pyx_v_outgoing)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sender = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2388
 *     """Callback for implementing authentication in Python."""
 *     sender = ServerAuthSender.wrap(outgoing)
 *     reader = ServerAuthReader.wrap(incoming)             # <<<<<<<<<<<<<<
 *     try:
 *         (<object> self).authenticate(sender, reader)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_7_flight_16ServerAuthReader_wrap(__pyx_v_incoming)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reader = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2389
 *     sender = ServerAuthSender.wrap(outgoing)
 *     reader = ServerAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
  /*try:*/ {
    {
      __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:*/ {

        /* "pyarrow/_flight.pyx":2390
 *     reader = ServerAuthReader.wrap(incoming)
 *     try:
 *         (<object> self).authenticate(sender, reader)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
        __pyx_t_5 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_sender), ((PyObject *)__pyx_v_reader)};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_authenticate, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/_flight.pyx":2389
 *     sender = ServerAuthSender.wrap(outgoing)
 *     reader = ServerAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/_flight.pyx":2391
 *     try:
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     finally:
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pyarrow._flight._server_authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2391, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_v_flight_error = __pyx_t_5;
        /*try:*/ {

          /* "pyarrow/_flight.pyx":2392
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     finally:
 *         sender.poison()
*/
          __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L17_error)
          __pyx_r = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L16_return;
        }

        /* "pyarrow/_flight.pyx":2391
 *     try:
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     finally:
*/
        /*finally:*/ {
          __pyx_L17_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
            __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
            goto __pyx_L8_except_error;
          }
          __pyx_L16_return: {
            __pyx_t_9 = __pyx_r;
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
            __pyx_r = __pyx_t_9;
            goto __pyx_L9_except_return;
          }
        }
      }
      goto __pyx_L8_except_error;

      /* "pyarrow/_flight.pyx":2389
 *     sender = ServerAuthSender.wrap(outgoing)
 *     reader = ServerAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
      __pyx_L8_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_L4_error;
      __pyx_L9_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_L3_return;
      __pyx_L11_try_end:;
    }
  }

  /* "pyarrow/_flight.pyx":2394
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
  /*finally:*/ {
    /*normal exit:*/{
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2395
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L1_error)
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      if ( unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_15);
      __pyx_t_10 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
      {

        /* "pyarrow/_flight.pyx":2394
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
        ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L24_error)

        /* "pyarrow/_flight.pyx":2395
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L24_error)
      }
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_18;
      goto __pyx_L1_error;
      __pyx_L24_error:;
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_9 = __pyx_r;

      /* "pyarrow/_flight.pyx":2394
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2395
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2395, __pyx_L1_error)
      __pyx_r = __pyx_t_9;
      goto __pyx_L0;
    }
    __pyx_L5:;
  }

  /* "pyarrow/_flight.pyx":2396
 *         sender.poison()
 *         reader.poison()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * cdef CStatus _is_valid(void* self, const c_string& token,
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2384
 * 
 * 
 * cdef CStatus _server_authenticate(void* self, CServerAuthSender* outgoing,             # <<<<<<<<<<<<<<
 *                                   CServerAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight._server_authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sender);
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2398
 *     return CStatus_OK()
 * 
 * cdef CStatus _is_valid(void* self, const c_string& token,             # <<<<<<<<<<<<<<
 *                        c_string* peer_identity) except *:
 *     """Callback for implementing authentication in Python."""
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__is_valid(void *__pyx_v_self, std::string const &__pyx_v_token, std::string *__pyx_v_peer_identity) {
  std::string __pyx_v_c_result;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  std::string __pyx_t_11;
  int __pyx_t_12;
  arrow::Status __pyx_t_13;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_valid", 0);

  /* "pyarrow/_flight.pyx":2402
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2403
 *     cdef c_string c_result
 *     try:
 *         c_result = tobytes((<object> self).is_valid(token))             # <<<<<<<<<<<<<<
 *         peer_identity[0] = c_result
 *     except FlightError as flight_error:
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2403, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_token); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2403, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_is_valid, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2403, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __pyx_t_10 = 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_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2403, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2403, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_c_result = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_11);

      /* "pyarrow/_flight.pyx":2404
 *     try:
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      (__pyx_v_peer_identity[0]) = __pyx_v_c_result;

      /* "pyarrow/_flight.pyx":2402
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/_flight.pyx":2405
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_12) {
      __Pyx_AddTraceback("pyarrow._flight._is_valid", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2405, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_flight_error = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2406
 *         peer_identity[0] = c_result
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_13 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2406, __pyx_L14_error)
        __pyx_r = __pyx_t_13;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2405
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
          if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_16);
          __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_t_12 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
          __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_13 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_13;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2402
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).is_valid(token))
 *         peer_identity[0] = c_result
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2407
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2398
 *     return CStatus_OK()
 * 
 * cdef CStatus _is_valid(void* self, const c_string& token,             # <<<<<<<<<<<<<<
 *                        c_string* peer_identity) except *:
 *     """Callback for implementing authentication in Python."""
*/

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

/* "pyarrow/_flight.pyx":2410
 * 
 * 
 * cdef CStatus _client_authenticate(void* self, CClientAuthSender* outgoing,             # <<<<<<<<<<<<<<
 *                                   CClientAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__client_authenticate(void *__pyx_v_self,  arrow::flight::ClientAuthSender *__pyx_v_outgoing,  arrow::flight::ClientAuthReader *__pyx_v_incoming) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *__pyx_v_sender = NULL;
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *__pyx_v_reader = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  char const *__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_client_authenticate", 0);

  /* "pyarrow/_flight.pyx":2413
 *                                   CClientAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
 *     sender = ClientAuthSender.wrap(outgoing)             # <<<<<<<<<<<<<<
 *     reader = ClientAuthReader.wrap(incoming)
 *     try:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_7_flight_16ClientAuthSender_wrap(__pyx_v_outgoing)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sender = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2414
 *     """Callback for implementing authentication in Python."""
 *     sender = ClientAuthSender.wrap(outgoing)
 *     reader = ClientAuthReader.wrap(incoming)             # <<<<<<<<<<<<<<
 *     try:
 *         (<object> self).authenticate(sender, reader)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_7_flight_16ClientAuthReader_wrap(__pyx_v_incoming)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_reader = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2415
 *     sender = ClientAuthSender.wrap(outgoing)
 *     reader = ClientAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
  /*try:*/ {
    {
      __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:*/ {

        /* "pyarrow/_flight.pyx":2416
 *     reader = ClientAuthReader.wrap(incoming)
 *     try:
 *         (<object> self).authenticate(sender, reader)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
        __pyx_t_5 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_sender), ((PyObject *)__pyx_v_reader)};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_authenticate, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2416, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "pyarrow/_flight.pyx":2415
 *     sender = ClientAuthSender.wrap(outgoing)
 *     reader = ClientAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/_flight.pyx":2417
 *     try:
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     finally:
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pyarrow._flight._client_authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2417, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_v_flight_error = __pyx_t_5;
        /*try:*/ {

          /* "pyarrow/_flight.pyx":2418
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     finally:
 *         sender.poison()
*/
          __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L17_error)
          __pyx_r = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L16_return;
        }

        /* "pyarrow/_flight.pyx":2417
 *     try:
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     finally:
*/
        /*finally:*/ {
          __pyx_L17_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
            if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_15);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
            }
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
            __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
            __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
            goto __pyx_L8_except_error;
          }
          __pyx_L16_return: {
            __pyx_t_9 = __pyx_r;
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
            __pyx_r = __pyx_t_9;
            goto __pyx_L9_except_return;
          }
        }
      }
      goto __pyx_L8_except_error;

      /* "pyarrow/_flight.pyx":2415
 *     sender = ClientAuthSender.wrap(outgoing)
 *     reader = ClientAuthReader.wrap(incoming)
 *     try:             # <<<<<<<<<<<<<<
 *         (<object> self).authenticate(sender, reader)
 *     except FlightError as flight_error:
*/
      __pyx_L8_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_L4_error;
      __pyx_L9_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_L3_return;
      __pyx_L11_try_end:;
    }
  }

  /* "pyarrow/_flight.pyx":2420
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
  /*finally:*/ {
    /*normal exit:*/{
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2421
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L1_error)
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
      if ( unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_15);
      __pyx_t_10 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
      {

        /* "pyarrow/_flight.pyx":2420
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
        ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L24_error)

        /* "pyarrow/_flight.pyx":2421
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L24_error)
      }
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_18;
      goto __pyx_L1_error;
      __pyx_L24_error:;
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_9 = __pyx_r;

      /* "pyarrow/_flight.pyx":2420
 *         return (<FlightError> flight_error).to_status()
 *     finally:
 *         sender.poison()             # <<<<<<<<<<<<<<
 *         reader.poison()
 *     return CStatus_OK()
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthSender *)__pyx_v_sender->__pyx_vtab)->poison(__pyx_v_sender); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2420, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2421
 *     finally:
 *         sender.poison()
 *         reader.poison()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
      ((struct __pyx_vtabstruct_7pyarrow_7_flight_ClientAuthReader *)__pyx_v_reader->__pyx_vtab)->poison(__pyx_v_reader); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L1_error)
      __pyx_r = __pyx_t_9;
      goto __pyx_L0;
    }
    __pyx_L5:;
  }

  /* "pyarrow/_flight.pyx":2422
 *         sender.poison()
 *         reader.poison()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2410
 * 
 * 
 * cdef CStatus _client_authenticate(void* self, CClientAuthSender* outgoing,             # <<<<<<<<<<<<<<
 *                                   CClientAuthReader* incoming) except *:
 *     """Callback for implementing authentication in Python."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight._client_authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sender);
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2425
 * 
 * 
 * cdef CStatus _get_token(void* self, c_string* token) except *:             # <<<<<<<<<<<<<<
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__get_token(void *__pyx_v_self, std::string *__pyx_v_token) {
  std::string __pyx_v_c_result;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  std::string __pyx_t_10;
  int __pyx_t_11;
  arrow::Status __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_token", 0);

  /* "pyarrow/_flight.pyx":2428
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2429
 *     cdef c_string c_result
 *     try:
 *         c_result = tobytes((<object> self).get_token())             # <<<<<<<<<<<<<<
 *         token[0] = c_result
 *     except FlightError as flight_error:
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2429, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_token, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2429, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
      }
      __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_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__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_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2429, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2429, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_c_result = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);

      /* "pyarrow/_flight.pyx":2430
 *     try:
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      (__pyx_v_token[0]) = __pyx_v_c_result;

      /* "pyarrow/_flight.pyx":2428
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/_flight.pyx":2431
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pyarrow._flight._get_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 2431, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_v_flight_error = __pyx_t_6;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2432
 *         token[0] = c_result
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_12 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2432, __pyx_L14_error)
        __pyx_r = __pyx_t_12;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2431
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
          if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __pyx_t_11 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_12 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_12;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2428
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
 *     try:             # <<<<<<<<<<<<<<
 *         c_result = tobytes((<object> self).get_token())
 *         token[0] = c_result
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2433
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2425
 * 
 * 
 * cdef CStatus _get_token(void* self, c_string* token) except *:             # <<<<<<<<<<<<<<
 *     """Callback for implementing authentication in Python."""
 *     cdef c_string c_result
*/

  /* 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("pyarrow._flight._get_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2436
 * 
 * 
 * cdef CStatus _middleware_sending_headers(             # <<<<<<<<<<<<<<
 *         void* self, CAddCallHeaders* add_headers) except *:
 *     """Callback for implementing middleware."""
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_sending_headers(void *__pyx_v_self,  arrow::flight::AddCallHeaders *__pyx_v_add_headers) {
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_value = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  PyObject *(*__pyx_t_23)(PyObject *);
  PyObject *__pyx_t_24 = NULL;
  std::string __pyx_t_25;
  std::string __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_middleware_sending_headers", 0);

  /* "pyarrow/_flight.pyx":2439
 *         void* self, CAddCallHeaders* add_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_error:
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2440
 *     """Callback for implementing middleware."""
 *     try:
 *         headers = (<object> self).sending_headers()             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_sending_headers, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2440, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_v_headers = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2439
 *         void* self, CAddCallHeaders* add_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_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;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2441
 *     try:
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow._flight._middleware_sending_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2441, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_flight_error = __pyx_t_5;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2442
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 *     if headers:
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2441
 *     try:
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2439
 *         void* self, CAddCallHeaders* add_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = (<object> self).sending_headers()
 *     except FlightError as flight_error:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2444
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if headers:             # <<<<<<<<<<<<<<
 *         for header, values in headers.items():
 *             if isinstance(values, (str, bytes)):
*/
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_headers); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 2444, __pyx_L1_error)
  if (__pyx_t_18) {

    /* "pyarrow/_flight.pyx":2445
 * 
 *     if headers:
 *         for header, values in headers.items():             # <<<<<<<<<<<<<<
 *             if isinstance(values, (str, bytes)):
 *                 values = (values,)
*/
    __pyx_t_19 = 0;
    if (unlikely(__pyx_v_headers == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 2445, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_headers, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_20), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_8);
    __pyx_t_8 = __pyx_t_5;
    __pyx_t_5 = 0;
    while (1) {
      __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_20, &__pyx_t_19, &__pyx_t_5, &__pyx_t_4, NULL, __pyx_t_10);
      if (unlikely(__pyx_t_7 == 0)) break;
      if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2445, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_header, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2446
 *     if headers:
 *         for header, values in headers.items():
 *             if isinstance(values, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 values = (values,)
 *             # Headers in gRPC (and HTTP/1, HTTP/2) are required to be
*/
      __pyx_t_21 = PyUnicode_Check(__pyx_v_values); 
      if (!__pyx_t_21) {
      } else {
        __pyx_t_18 = __pyx_t_21;
        goto __pyx_L24_bool_binop_done;
      }
      __pyx_t_21 = PyBytes_Check(__pyx_v_values); 
      __pyx_t_18 = __pyx_t_21;
      __pyx_L24_bool_binop_done:;
      if (__pyx_t_18) {

        /* "pyarrow/_flight.pyx":2447
 *         for header, values in headers.items():
 *             if isinstance(values, (str, bytes)):
 *                 values = (values,)             # <<<<<<<<<<<<<<
 *             # Headers in gRPC (and HTTP/1, HTTP/2) are required to be
 *             # valid, lowercase ASCII.
*/
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_values);
        __Pyx_GIVEREF(__pyx_v_values);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_values) != (0)) __PYX_ERR(0, 2447, __pyx_L1_error);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "pyarrow/_flight.pyx":2446
 *     if headers:
 *         for header, values in headers.items():
 *             if isinstance(values, (str, bytes)):             # <<<<<<<<<<<<<<
 *                 values = (values,)
 *             # Headers in gRPC (and HTTP/1, HTTP/2) are required to be
*/
      }

      /* "pyarrow/_flight.pyx":2450
 *             # Headers in gRPC (and HTTP/1, HTTP/2) are required to be
 *             # valid, lowercase ASCII.
 *             header = header.lower()             # <<<<<<<<<<<<<<
 *             if isinstance(header, str):
 *                 header = header.encode("ascii")
*/
      __pyx_t_5 = __pyx_v_header;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2450, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_header, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2451
 *             # valid, lowercase ASCII.
 *             header = header.lower()
 *             if isinstance(header, str):             # <<<<<<<<<<<<<<
 *                 header = header.encode("ascii")
 *             for value in values:
*/
      __pyx_t_18 = PyUnicode_Check(__pyx_v_header); 
      if (__pyx_t_18) {

        /* "pyarrow/_flight.pyx":2452
 *             header = header.lower()
 *             if isinstance(header, str):
 *                 header = header.encode("ascii")             # <<<<<<<<<<<<<<
 *             for value in values:
 *                 if isinstance(value, str):
*/
        __pyx_t_5 = __pyx_v_header;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ascii};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF_SET(__pyx_v_header, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "pyarrow/_flight.pyx":2451
 *             # valid, lowercase ASCII.
 *             header = header.lower()
 *             if isinstance(header, str):             # <<<<<<<<<<<<<<
 *                 header = header.encode("ascii")
 *             for value in values:
*/
      }

      /* "pyarrow/_flight.pyx":2453
 *             if isinstance(header, str):
 *                 header = header.encode("ascii")
 *             for value in values:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, str):
 *                     value = value.encode("ascii")
*/
      if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
        __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4);
        __pyx_t_22 = 0;
        __pyx_t_23 = NULL;
      } else {
        __pyx_t_22 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2453, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_23 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2453, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_23)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2453, __pyx_L1_error)
              #endif
              if (__pyx_t_22 >= __pyx_temp) break;
            }
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_22, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_22;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2453, __pyx_L1_error)
              #endif
              if (__pyx_t_22 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_22));
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_22);
            #endif
            ++__pyx_t_22;
          }
          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2453, __pyx_L1_error)
        } else {
          __pyx_t_5 = __pyx_t_23(__pyx_t_4);
          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, 2453, __pyx_L1_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "pyarrow/_flight.pyx":2454
 *                 header = header.encode("ascii")
 *             for value in values:
 *                 if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                     value = value.encode("ascii")
 *                 # Allow bytes values to pass through.
*/
        __pyx_t_18 = PyUnicode_Check(__pyx_v_value); 
        if (__pyx_t_18) {

          /* "pyarrow/_flight.pyx":2455
 *             for value in values:
 *                 if isinstance(value, str):
 *                     value = value.encode("ascii")             # <<<<<<<<<<<<<<
 *                 # Allow bytes values to pass through.
 *                 add_headers.AddHeader(header, value)
*/
          __pyx_t_24 = __pyx_v_value;
          __Pyx_INCREF(__pyx_t_24);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_mstate_global->__pyx_n_u_ascii};
            __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2455, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "pyarrow/_flight.pyx":2454
 *                 header = header.encode("ascii")
 *             for value in values:
 *                 if isinstance(value, str):             # <<<<<<<<<<<<<<
 *                     value = value.encode("ascii")
 *                 # Allow bytes values to pass through.
*/
        }

        /* "pyarrow/_flight.pyx":2457
 *                     value = value.encode("ascii")
 *                 # Allow bytes values to pass through.
 *                 add_headers.AddHeader(header, value)             # <<<<<<<<<<<<<<
 * 
 *     return CStatus_OK()
*/
        __pyx_t_25 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_header); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L1_error)
        __pyx_t_26 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2457, __pyx_L1_error)
        __pyx_v_add_headers->AddHeader(__pyx_t_25, __pyx_t_26);

        /* "pyarrow/_flight.pyx":2453
 *             if isinstance(header, str):
 *                 header = header.encode("ascii")
 *             for value in values:             # <<<<<<<<<<<<<<
 *                 if isinstance(value, str):
 *                     value = value.encode("ascii")
*/
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/_flight.pyx":2444
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if headers:             # <<<<<<<<<<<<<<
 *         for header, values in headers.items():
 *             if isinstance(values, (str, bytes)):
*/
  }

  /* "pyarrow/_flight.pyx":2459
 *                 add_headers.AddHeader(header, value)
 * 
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2436
 * 
 * 
 * cdef CStatus _middleware_sending_headers(             # <<<<<<<<<<<<<<
 *         void* self, CAddCallHeaders* add_headers) except *:
 *     """Callback for implementing middleware."""
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("pyarrow._flight._middleware_sending_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2462
 * 
 * 
 * cdef CStatus _middleware_call_completed(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CStatus& call_status) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_call_completed(void *__pyx_v_self, arrow::Status const &__pyx_v_call_status) {
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  char const *__pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  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;
  arrow::Status __pyx_t_22;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_middleware_call_completed", 0);

  /* "pyarrow/_flight.pyx":2466
 *         const CStatus& call_status) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             check_flight_status(call_status)
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2467
 *     """Callback for implementing middleware."""
 *     try:
 *         try:             # <<<<<<<<<<<<<<
 *             check_flight_status(call_status)
 *         except Exception as e:
*/
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        /*try:*/ {

          /* "pyarrow/_flight.pyx":2468
 *     try:
 *         try:
 *             check_flight_status(call_status)             # <<<<<<<<<<<<<<
 *         except Exception as e:
 *             (<object> self).call_completed(e)
*/
          __pyx_t_7 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_call_status); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 2468, __pyx_L9_error)

          /* "pyarrow/_flight.pyx":2467
 *     """Callback for implementing middleware."""
 *     try:
 *         try:             # <<<<<<<<<<<<<<
 *             check_flight_status(call_status)
 *         except Exception as e:
*/
        }

        /* "pyarrow/_flight.pyx":2472
 *             (<object> self).call_completed(e)
 *         else:
 *             (<object> self).call_completed(None)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
        /*else:*/ {
          __pyx_t_9 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, Py_None};
            __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_completed, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2472, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_8);
          }
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L14_try_end;
        __pyx_L9_error:;

        /* "pyarrow/_flight.pyx":2469
 *         try:
 *             check_flight_status(call_status)
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             (<object> self).call_completed(e)
 *         else:
*/
        __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
        if (__pyx_t_7) {
          __Pyx_AddTraceback("pyarrow._flight._middleware_call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(0, 2469, __pyx_L11_except_error)
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_9);
          __pyx_v_e = __pyx_t_9;
          /*try:*/ {

            /* "pyarrow/_flight.pyx":2470
 *             check_flight_status(call_status)
 *         except Exception as e:
 *             (<object> self).call_completed(e)             # <<<<<<<<<<<<<<
 *         else:
 *             (<object> self).call_completed(None)
*/
            __pyx_t_13 = ((PyObject *)__pyx_v_self);
            __Pyx_INCREF(__pyx_t_13);
            __pyx_t_10 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_e};
              __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_completed, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2470, __pyx_L20_error)
              __Pyx_GOTREF(__pyx_t_12);
            }
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }

          /* "pyarrow/_flight.pyx":2469
 *         try:
 *             check_flight_status(call_status)
 *         except Exception as e:             # <<<<<<<<<<<<<<
 *             (<object> self).call_completed(e)
 *         else:
*/
          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              goto __pyx_L21;
            }
            __pyx_L20_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
              if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
              __Pyx_XGOTREF(__pyx_t_16);
              __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_t_7 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
              __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
              __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
              goto __pyx_L11_except_error;
            }
            __pyx_L21:;
          }
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L10_exception_handled;
        }
        goto __pyx_L11_except_error;

        /* "pyarrow/_flight.pyx":2467
 *     """Callback for implementing middleware."""
 *     try:
 *         try:             # <<<<<<<<<<<<<<
 *             check_flight_status(call_status)
 *         except Exception as e:
*/
        __pyx_L11_except_error:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L3_error;
        __pyx_L10_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L14_try_end:;
      }

      /* "pyarrow/_flight.pyx":2466
 *         const CStatus& call_status) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             check_flight_status(call_status)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_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_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/_flight.pyx":2473
 *         else:
 *             (<object> self).call_completed(None)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_14) {
      __Pyx_AddTraceback("pyarrow._flight._middleware_call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 2473, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_v_flight_error = __pyx_t_9;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2474
 *             (<object> self).call_completed(None)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_22 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2474, __pyx_L31_error)
        __pyx_r = __pyx_t_22;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L30_return;
      }

      /* "pyarrow/_flight.pyx":2473
 *         else:
 *             (<object> self).call_completed(None)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L31_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
          if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __pyx_t_14 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_20, __pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0;
          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_23;
          goto __pyx_L5_except_error;
        }
        __pyx_L30_return: {
          __pyx_t_22 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_22;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2466
 *         const CStatus& call_status) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         try:
 *             check_flight_status(call_status)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2475
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2462
 * 
 * 
 * cdef CStatus _middleware_call_completed(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CStatus& call_status) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow._flight._middleware_call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2478
 * 
 * 
 * cdef CStatus _middleware_received_headers(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallHeaders& c_headers) except *:
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__middleware_received_headers(void *__pyx_v_self,  arrow::flight::CallHeaders const &__pyx_v_c_headers) {
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_middleware_received_headers", 0);

  /* "pyarrow/_flight.pyx":2482
 *         const CCallHeaders& c_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2483
 *     """Callback for implementing middleware."""
 *     try:
 *         headers = convert_headers(c_headers)             # <<<<<<<<<<<<<<
 *         (<object> self).received_headers(headers)
 *     except FlightError as flight_error:
*/
      __pyx_t_4 = __pyx_f_7pyarrow_7_flight_convert_headers(__pyx_v_c_headers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2483, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_headers = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2484
 *     try:
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_headers};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_received_headers, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2482
 *         const CCallHeaders& c_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2485
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow._flight._middleware_received_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2485, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_flight_error = __pyx_t_5;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2486
 *         (<object> self).received_headers(headers)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 *     return CStatus_OK()
 * 
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2485
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2482
 *         const CCallHeaders& c_headers) except *:
 *     """Callback for implementing middleware."""
 *     try:             # <<<<<<<<<<<<<<
 *         headers = convert_headers(c_headers)
 *         (<object> self).received_headers(headers)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2487
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2478
 * 
 * 
 * cdef CStatus _middleware_received_headers(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallHeaders& c_headers) except *:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight._middleware_received_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2490
 * 
 * 
 * cdef dict convert_headers(const CCallHeaders& c_headers):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCallHeaders.const_iterator header_iter = c_headers.cbegin()
*/

static PyObject *__pyx_f_7pyarrow_7_flight_convert_headers( arrow::flight::CallHeaders const &__pyx_v_c_headers) {
  std::multimap<std::string_view,std::string_view> ::const_iterator __pyx_v_header_iter;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_header = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_headers", 0);

  /* "pyarrow/_flight.pyx":2492
 * cdef dict convert_headers(const CCallHeaders& c_headers):
 *     cdef:
 *         CCallHeaders.const_iterator header_iter = c_headers.cbegin()             # <<<<<<<<<<<<<<
 *     headers = {}
 *     while header_iter != c_headers.cend():
*/
  try {
    __pyx_v_header_iter = __pyx_v_c_headers.cbegin();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2492, __pyx_L1_error)
  }

  /* "pyarrow/_flight.pyx":2493
 *     cdef:
 *         CCallHeaders.const_iterator header_iter = c_headers.cbegin()
 *     headers = {}             # <<<<<<<<<<<<<<
 *     while header_iter != c_headers.cend():
 *         header = to_string(deref(header_iter).first).decode("ascii")
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_headers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2494
 *         CCallHeaders.const_iterator header_iter = c_headers.cbegin()
 *     headers = {}
 *     while header_iter != c_headers.cend():             # <<<<<<<<<<<<<<
 *         header = to_string(deref(header_iter).first).decode("ascii")
 *         value = to_string(deref(header_iter).second)
*/
  while (1) {
    __pyx_t_2 = (__pyx_v_header_iter != __pyx_v_c_headers.cend());
    if (!__pyx_t_2) break;

    /* "pyarrow/_flight.pyx":2495
 *     headers = {}
 *     while header_iter != c_headers.cend():
 *         header = to_string(deref(header_iter).first).decode("ascii")             # <<<<<<<<<<<<<<
 *         value = to_string(deref(header_iter).second)
 *         if not header.endswith("-bin"):
*/
    __pyx_t_1 = __Pyx_decode_cpp_string(arrow::py::to_string((*__pyx_v_header_iter).first), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_header, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":2496
 *     while header_iter != c_headers.cend():
 *         header = to_string(deref(header_iter).first).decode("ascii")
 *         value = to_string(deref(header_iter).second)             # <<<<<<<<<<<<<<
 *         if not header.endswith("-bin"):
 *             # Text header values in gRPC (and HTTP/1, HTTP/2) are
*/
    __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(arrow::py::to_string((*__pyx_v_header_iter).second)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":2497
 *         header = to_string(deref(header_iter).first).decode("ascii")
 *         value = to_string(deref(header_iter).second)
 *         if not header.endswith("-bin"):             # <<<<<<<<<<<<<<
 *             # Text header values in gRPC (and HTTP/1, HTTP/2) are
 *             # required to be valid ASCII. Binary header values are
*/
    __pyx_t_3 = __pyx_v_header;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_bin};
      __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_endswith, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2497, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = (!__pyx_t_2);
    if (__pyx_t_5) {

      /* "pyarrow/_flight.pyx":2501
 *             # required to be valid ASCII. Binary header values are
 *             # exposed as bytes.
 *             value = value.decode("ascii")             # <<<<<<<<<<<<<<
 *         headers.setdefault(header, []).append(value)
 *         postincrement(header_iter)
*/
      __pyx_t_3 = __pyx_v_value;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascii};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/_flight.pyx":2497
 *         header = to_string(deref(header_iter).first).decode("ascii")
 *         value = to_string(deref(header_iter).second)
 *         if not header.endswith("-bin"):             # <<<<<<<<<<<<<<
 *             # Text header values in gRPC (and HTTP/1, HTTP/2) are
 *             # required to be valid ASCII. Binary header values are
*/
    }

    /* "pyarrow/_flight.pyx":2502
 *             # exposed as bytes.
 *             value = value.decode("ascii")
 *         headers.setdefault(header, []).append(value)             # <<<<<<<<<<<<<<
 *         postincrement(header_iter)
 *     return headers
*/
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyDict_SetDefault(__pyx_v_headers, __pyx_v_header, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_value); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 2502, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":2503
 *             value = value.decode("ascii")
 *         headers.setdefault(header, []).append(value)
 *         postincrement(header_iter)             # <<<<<<<<<<<<<<
 *     return headers
 * 
*/
    (void)((__pyx_v_header_iter++));
  }

  /* "pyarrow/_flight.pyx":2504
 *         headers.setdefault(header, []).append(value)
 *         postincrement(header_iter)
 *     return headers             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_headers);
  __pyx_r = __pyx_v_headers;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2490
 * 
 * 
 * cdef dict convert_headers(const CCallHeaders& c_headers):             # <<<<<<<<<<<<<<
 *     cdef:
 *         CCallHeaders.const_iterator header_iter = c_headers.cbegin()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.convert_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_header);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2507
 * 
 * 
 * cdef CStatus _server_middleware_start_call(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallInfo& c_info,
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__server_middleware_start_call(void *__pyx_v_self,  arrow::flight::CallInfo const &__pyx_v_c_info,  arrow::flight::CallHeaders const &__pyx_v_c_headers, std::shared_ptr< arrow::flight::ServerMiddleware>  *__pyx_v_c_instance) {
  PyObject *__pyx_v_instance = NULL;
  PyObject *__pyx_v_call_info = NULL;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_server_middleware_start_call", 0);

  /* "pyarrow/_flight.pyx":2513
 *         shared_ptr[CServerMiddleware]* c_instance) except *:
 *     """Callback for implementing server middleware."""
 *     instance = None             # <<<<<<<<<<<<<<
 *     try:
 *         call_info = wrap_call_info(c_info)
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_instance = Py_None;

  /* "pyarrow/_flight.pyx":2514
 *     """Callback for implementing server middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         headers = convert_headers(c_headers)
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2515
 *     instance = None
 *     try:
 *         call_info = wrap_call_info(c_info)             # <<<<<<<<<<<<<<
 *         headers = convert_headers(c_headers)
 *         instance = (<object> self).start_call(call_info, headers)
*/
      __pyx_t_4 = __pyx_f_7pyarrow_7_flight_wrap_call_info(__pyx_v_c_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2515, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_call_info = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2516
 *     try:
 *         call_info = wrap_call_info(c_info)
 *         headers = convert_headers(c_headers)             # <<<<<<<<<<<<<<
 *         instance = (<object> self).start_call(call_info, headers)
 *     except FlightError as flight_error:
*/
      __pyx_t_4 = __pyx_f_7pyarrow_7_flight_convert_headers(__pyx_v_c_headers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2516, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_headers = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2517
 *         call_info = wrap_call_info(c_info)
 *         headers = convert_headers(c_headers)
 *         instance = (<object> self).start_call(call_info, headers)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_call_info, __pyx_v_headers};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start_call, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2517, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_instance, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2514
 *     """Callback for implementing server middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         headers = convert_headers(c_headers)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2518
 *         headers = convert_headers(c_headers)
 *         instance = (<object> self).start_call(call_info, headers)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow._flight._server_middleware_start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2518, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_flight_error = __pyx_t_5;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2519
 *         instance = (<object> self).start_call(call_info, headers)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 *     if instance:
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2519, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2518
 *         headers = convert_headers(c_headers)
 *         instance = (<object> self).start_call(call_info, headers)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2514
 *     """Callback for implementing server middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         headers = convert_headers(c_headers)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2521
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if instance:             # <<<<<<<<<<<<<<
 *         ServerMiddleware.wrap(instance, c_instance)
 * 
*/
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 2521, __pyx_L1_error)
  if (__pyx_t_18) {

    /* "pyarrow/_flight.pyx":2522
 * 
 *     if instance:
 *         ServerMiddleware.wrap(instance, c_instance)             # <<<<<<<<<<<<<<
 * 
 *     return CStatus_OK()
*/
    __pyx_f_7pyarrow_7_flight_16ServerMiddleware_wrap(__pyx_v_instance, __pyx_v_c_instance); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2521
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if instance:             # <<<<<<<<<<<<<<
 *         ServerMiddleware.wrap(instance, c_instance)
 * 
*/
  }

  /* "pyarrow/_flight.pyx":2524
 *         ServerMiddleware.wrap(instance, c_instance)
 * 
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2507
 * 
 * 
 * cdef CStatus _server_middleware_start_call(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallInfo& c_info,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight._server_middleware_start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XDECREF(__pyx_v_call_info);
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2527
 * 
 * 
 * cdef CStatus _client_middleware_start_call(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallInfo& c_info,
*/

static arrow::Status __pyx_f_7pyarrow_7_flight__client_middleware_start_call(void *__pyx_v_self,  arrow::flight::CallInfo const &__pyx_v_c_info, std::unique_ptr< arrow::flight::ClientMiddleware>  *__pyx_v_c_instance) {
  PyObject *__pyx_v_instance = NULL;
  PyObject *__pyx_v_call_info = NULL;
  PyObject *__pyx_v_flight_error = NULL;
  arrow::Status __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;
  PyObject *__pyx_t_8 = NULL;
  arrow::Status __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_client_middleware_start_call", 0);

  /* "pyarrow/_flight.pyx":2532
 *         unique_ptr[CClientMiddleware]* c_instance) except *:
 *     """Callback for implementing client middleware."""
 *     instance = None             # <<<<<<<<<<<<<<
 *     try:
 *         call_info = wrap_call_info(c_info)
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_instance = Py_None;

  /* "pyarrow/_flight.pyx":2533
 *     """Callback for implementing client middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)
*/
  {
    __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:*/ {

      /* "pyarrow/_flight.pyx":2534
 *     instance = None
 *     try:
 *         call_info = wrap_call_info(c_info)             # <<<<<<<<<<<<<<
 *         instance = (<object> self).start_call(call_info)
 *     except FlightError as flight_error:
*/
      __pyx_t_4 = __pyx_f_7pyarrow_7_flight_wrap_call_info(__pyx_v_c_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2534, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_call_info = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2535
 *     try:
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)             # <<<<<<<<<<<<<<
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()
*/
      __pyx_t_5 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_call_info};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start_call, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2535, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_instance, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2533
 *     """Callback for implementing client middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2536
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError));
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pyarrow._flight._client_middleware_start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 2536, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_v_flight_error = __pyx_t_5;
      /*try:*/ {

        /* "pyarrow/_flight.pyx":2537
 *         instance = (<object> self).start_call(call_info)
 *     except FlightError as flight_error:
 *         return (<FlightError> flight_error).to_status()             # <<<<<<<<<<<<<<
 * 
 *     if instance:
*/
        __pyx_t_9 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError *)((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)->__pyx_vtab)->to_status(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v_flight_error)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L14_error)
        __pyx_r = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13_return;
      }

      /* "pyarrow/_flight.pyx":2536
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)
 *     except FlightError as flight_error:             # <<<<<<<<<<<<<<
 *         return (<FlightError> flight_error).to_status()
 * 
*/
      /*finally:*/ {
        __pyx_L14_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_XGOTREF(__pyx_t_14);
          __Pyx_XGOTREF(__pyx_t_15);
          __Pyx_XGOTREF(__pyx_t_16);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L5_except_error;
        }
        __pyx_L13_return: {
          __pyx_t_9 = __pyx_r;
          __Pyx_DECREF(__pyx_v_flight_error); __pyx_v_flight_error = 0;
          __pyx_r = __pyx_t_9;
          goto __pyx_L6_except_return;
        }
      }
    }
    goto __pyx_L5_except_error;

    /* "pyarrow/_flight.pyx":2533
 *     """Callback for implementing client middleware."""
 *     instance = None
 *     try:             # <<<<<<<<<<<<<<
 *         call_info = wrap_call_info(c_info)
 *         instance = (<object> self).start_call(call_info)
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L8_try_end:;
  }

  /* "pyarrow/_flight.pyx":2539
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if instance:             # <<<<<<<<<<<<<<
 *         ClientMiddleware.wrap(instance, c_instance)
 * 
*/
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 2539, __pyx_L1_error)
  if (__pyx_t_18) {

    /* "pyarrow/_flight.pyx":2540
 * 
 *     if instance:
 *         ClientMiddleware.wrap(instance, c_instance)             # <<<<<<<<<<<<<<
 * 
 *     return CStatus_OK()
*/
    __pyx_f_7pyarrow_7_flight_16ClientMiddleware_wrap(__pyx_v_instance, __pyx_v_c_instance); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2539
 *         return (<FlightError> flight_error).to_status()
 * 
 *     if instance:             # <<<<<<<<<<<<<<
 *         ClientMiddleware.wrap(instance, c_instance)
 * 
*/
  }

  /* "pyarrow/_flight.pyx":2542
 *         ClientMiddleware.wrap(instance, c_instance)
 * 
 *     return CStatus_OK()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = arrow::Status::OK();
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2527
 * 
 * 
 * cdef CStatus _client_middleware_start_call(             # <<<<<<<<<<<<<<
 *         void* self,
 *         const CCallInfo& c_info,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow._flight._client_middleware_start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XDECREF(__pyx_v_call_info);
  __Pyx_XDECREF(__pyx_v_flight_error);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2553
 *     """
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the client.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_1authenticate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_authenticate, "ServerAuthHandler.authenticate(self, outgoing, incoming)\n\nConduct the handshake with the client.\n\nMay raise an error if the client cannot authenticate.\n\nParameters\n----------\noutgoing : ServerAuthSender\n    A channel to send messages to the client.\nincoming : ServerAuthReader\n    A channel to read messages from the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_1authenticate = {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_1authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_authenticate};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_1authenticate(PyObject *__pyx_v_self, 
#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_outgoing = 0;
  CYTHON_UNUSED PyObject *__pyx_v_incoming = 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("authenticate (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_outgoing,&__pyx_mstate_global->__pyx_n_u_incoming,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, 2553, __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, 2553, __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, 2553, __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, "authenticate", 0) < (0)) __PYX_ERR(0, 2553, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("authenticate", 1, 2, 2, i); __PYX_ERR(0, 2553, __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, 2553, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2553, __pyx_L3_error)
    }
    __pyx_v_outgoing = values[0];
    __pyx_v_incoming = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("authenticate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2553, __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("pyarrow._flight.ServerAuthHandler.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_authenticate(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_self), __pyx_v_outgoing, __pyx_v_incoming);

  /* 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_7pyarrow_7_flight_17ServerAuthHandler_authenticate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_outgoing, CYTHON_UNUSED PyObject *__pyx_v_incoming) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("authenticate", 0);

  /* "pyarrow/_flight.pyx":2565
 *             A channel to read messages from the client.
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def is_valid(self, token):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 2565, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2553
 *     """
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the client.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthHandler.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2567
 *         raise NotImplementedError
 * 
 *     def is_valid(self, token):             # <<<<<<<<<<<<<<
 *         """Validate a client token, returning their identity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_3is_valid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_2is_valid, "ServerAuthHandler.is_valid(self, token)\n\nValidate a client token, returning their identity.\n\nMay return an empty string (if the auth mechanism does not\nname the peer) or raise an exception (if the token is\ninvalid).\n\nParameters\n----------\ntoken : bytes\n    The authentication token from the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_3is_valid = {"is_valid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_3is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_2is_valid};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_3is_valid(PyObject *__pyx_v_self, 
#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_token = 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("is_valid (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_token,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  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, "is_valid", 0) < (0)) __PYX_ERR(0, 2567, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_valid", 1, 1, 1, i); __PYX_ERR(0, 2567, __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, 2567, __pyx_L3_error)
    }
    __pyx_v_token = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_valid", 1, 1, 1, __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("pyarrow._flight.ServerAuthHandler.is_valid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_2is_valid(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_self), __pyx_v_token);

  /* 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_7pyarrow_7_flight_17ServerAuthHandler_2is_valid(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_token) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_valid", 0);

  /* "pyarrow/_flight.pyx":2580
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef PyServerAuthHandler* to_handler(self):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 2580, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2567
 *         raise NotImplementedError
 * 
 *     def is_valid(self, token):             # <<<<<<<<<<<<<<
 *         """Validate a client token, returning their identity.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthHandler.is_valid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2582
 *         raise NotImplementedError
 * 
 *     cdef PyServerAuthHandler* to_handler(self):             # <<<<<<<<<<<<<<
 *         cdef PyServerAuthHandlerVtable vtable
 *         vtable.authenticate = _server_authenticate
*/

static  arrow::py::flight::PyServerAuthHandler *__pyx_f_7pyarrow_7_flight_17ServerAuthHandler_to_handler(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self) {
  arrow::py::flight::PyServerAuthHandlerVtable __pyx_v_vtable;
   arrow::py::flight::PyServerAuthHandler *__pyx_r;

  /* "pyarrow/_flight.pyx":2584
 *     cdef PyServerAuthHandler* to_handler(self):
 *         cdef PyServerAuthHandlerVtable vtable
 *         vtable.authenticate = _server_authenticate             # <<<<<<<<<<<<<<
 *         vtable.is_valid = _is_valid
 *         return new PyServerAuthHandler(self, vtable)
*/
  __pyx_v_vtable.authenticate = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_server_authenticate> )__pyx_f_7pyarrow_7_flight__server_authenticate);

  /* "pyarrow/_flight.pyx":2585
 *         cdef PyServerAuthHandlerVtable vtable
 *         vtable.authenticate = _server_authenticate
 *         vtable.is_valid = _is_valid             # <<<<<<<<<<<<<<
 *         return new PyServerAuthHandler(self, vtable)
 * 
*/
  __pyx_v_vtable.is_valid = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_is_valid> )__pyx_f_7pyarrow_7_flight__is_valid);

  /* "pyarrow/_flight.pyx":2586
 *         vtable.authenticate = _server_authenticate
 *         vtable.is_valid = _is_valid
 *         return new PyServerAuthHandler(self, vtable)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = new  arrow::py::flight::PyServerAuthHandler(((PyObject *)__pyx_v_self), __pyx_v_vtable);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2582
 *         raise NotImplementedError
 * 
 *     cdef PyServerAuthHandler* to_handler(self):             # <<<<<<<<<<<<<<
 *         cdef PyServerAuthHandlerVtable vtable
 *         vtable.authenticate = _server_authenticate
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__, "ServerAuthHandler.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerAuthHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerAuthHandler__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerAuthHandler); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerAuthHandler__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__, "ServerAuthHandler.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ServerAuthHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__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_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerAuthHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerAuthHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerAuthHandler__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ServerAuthHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2592
 *     """Authentication plugin for a client."""
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the server.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_1authenticate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_authenticate, "ClientAuthHandler.authenticate(self, outgoing, incoming)\n\nConduct the handshake with the server.\n\nParameters\n----------\noutgoing : ClientAuthSender\n    A channel to send messages to the server.\nincoming : ClientAuthReader\n    A channel to read messages from the server.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_1authenticate = {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_1authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_authenticate};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_1authenticate(PyObject *__pyx_v_self, 
#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_outgoing = 0;
  CYTHON_UNUSED PyObject *__pyx_v_incoming = 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("authenticate (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_outgoing,&__pyx_mstate_global->__pyx_n_u_incoming,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, 2592, __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, 2592, __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, 2592, __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, "authenticate", 0) < (0)) __PYX_ERR(0, 2592, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("authenticate", 1, 2, 2, i); __PYX_ERR(0, 2592, __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, 2592, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2592, __pyx_L3_error)
    }
    __pyx_v_outgoing = values[0];
    __pyx_v_incoming = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("authenticate", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2592, __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("pyarrow._flight.ClientAuthHandler.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_authenticate(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v_self), __pyx_v_outgoing, __pyx_v_incoming);

  /* 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_7pyarrow_7_flight_17ClientAuthHandler_authenticate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_outgoing, CYTHON_UNUSED PyObject *__pyx_v_incoming) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("authenticate", 0);

  /* "pyarrow/_flight.pyx":2602
 *             A channel to read messages from the server.
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def get_token(self):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 2602, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2592
 *     """Authentication plugin for a client."""
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the server.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthHandler.authenticate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2604
 *         raise NotImplementedError
 * 
 *     def get_token(self):             # <<<<<<<<<<<<<<
 *         """Get the auth token for a call."""
 *         raise NotImplementedError
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_3get_token(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_2get_token, "ClientAuthHandler.get_token(self)\n\nGet the auth token for a call.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_3get_token = {"get_token", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_3get_token, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_2get_token};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_3get_token(PyObject *__pyx_v_self, 
#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_token (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_token", 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_token", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_2get_token(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_2get_token(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_token", 0);

  /* "pyarrow/_flight.pyx":2606
 *     def get_token(self):
 *         """Get the auth token for a call."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef PyClientAuthHandler* to_handler(self):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 2606, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2604
 *         raise NotImplementedError
 * 
 *     def get_token(self):             # <<<<<<<<<<<<<<
 *         """Get the auth token for a call."""
 *         raise NotImplementedError
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthHandler.get_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2608
 *         raise NotImplementedError
 * 
 *     cdef PyClientAuthHandler* to_handler(self):             # <<<<<<<<<<<<<<
 *         cdef PyClientAuthHandlerVtable vtable
 *         vtable.authenticate = _client_authenticate
*/

static  arrow::py::flight::PyClientAuthHandler *__pyx_f_7pyarrow_7_flight_17ClientAuthHandler_to_handler(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self) {
  arrow::py::flight::PyClientAuthHandlerVtable __pyx_v_vtable;
   arrow::py::flight::PyClientAuthHandler *__pyx_r;

  /* "pyarrow/_flight.pyx":2610
 *     cdef PyClientAuthHandler* to_handler(self):
 *         cdef PyClientAuthHandlerVtable vtable
 *         vtable.authenticate = _client_authenticate             # <<<<<<<<<<<<<<
 *         vtable.get_token = _get_token
 *         return new PyClientAuthHandler(self, vtable)
*/
  __pyx_v_vtable.authenticate = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_authenticate> )__pyx_f_7pyarrow_7_flight__client_authenticate);

  /* "pyarrow/_flight.pyx":2611
 *         cdef PyClientAuthHandlerVtable vtable
 *         vtable.authenticate = _client_authenticate
 *         vtable.get_token = _get_token             # <<<<<<<<<<<<<<
 *         return new PyClientAuthHandler(self, vtable)
 * 
*/
  __pyx_v_vtable.get_token = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_token> )__pyx_f_7pyarrow_7_flight__get_token);

  /* "pyarrow/_flight.pyx":2612
 *         vtable.authenticate = _client_authenticate
 *         vtable.get_token = _get_token
 *         return new PyClientAuthHandler(self, vtable)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = new  arrow::py::flight::PyClientAuthHandler(((PyObject *)__pyx_v_self), __pyx_v_vtable);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2608
 *         raise NotImplementedError
 * 
 *     cdef PyClientAuthHandler* to_handler(self):             # <<<<<<<<<<<<<<
 *         cdef PyClientAuthHandlerVtable vtable
 *         vtable.authenticate = _client_authenticate
*/

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__, "ClientAuthHandler.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientAuthHandler); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientAuthHandler__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientAuthHandler); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthHandler.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientAuthHandler__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__, "ClientAuthHandler.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ClientAuthHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__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_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientAuthHandler__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientAuthHandler__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientAuthHandler__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ClientAuthHandler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2622
 * 
 * 
 * cdef wrap_call_info(const CCallInfo& c_info):             # <<<<<<<<<<<<<<
 *     method = wrap_flight_method(c_info.method)
 *     return CallInfo(method=method)
*/

static PyObject *__pyx_f_7pyarrow_7_flight_wrap_call_info( arrow::flight::CallInfo const &__pyx_v_c_info) {
  PyObject *__pyx_v_method = NULL;
  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;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wrap_call_info", 0);

  /* "pyarrow/_flight.pyx":2623
 * 
 * cdef wrap_call_info(const CCallInfo& c_info):
 *     method = wrap_flight_method(c_info.method)             # <<<<<<<<<<<<<<
 *     return CallInfo(method=method)
 * 
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_wrap_flight_method(__pyx_v_c_info.method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_method = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2624
 * cdef wrap_call_info(const CCallInfo& c_info):
 *     method = wrap_flight_method(c_info.method)
 *     return CallInfo(method=method)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CallInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __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 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_method, __pyx_v_method, __pyx_t_5, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 2624, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __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, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2622
 * 
 * 
 * cdef wrap_call_info(const CCallInfo& c_info):             # <<<<<<<<<<<<<<
 *     method = wrap_flight_method(c_info.method)
 *     return CallInfo(method=method)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.wrap_call_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_method);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2636
 *     """
 * 
 *     def start_call(self, info):             # <<<<<<<<<<<<<<
 *         """Called at the start of an RPC.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call, "ClientMiddlewareFactory.start_call(self, info)\n\nCalled at the start of an RPC.\n\nThis must be thread-safe and must not raise exceptions.\n\nParameters\n----------\ninfo : CallInfo\n    Information about the call.\n\nReturns\n-------\ninstance : ClientMiddleware\n    An instance of ClientMiddleware (the instance to use for\n    the call), or None if this call is not intercepted.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call = {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call(PyObject *__pyx_v_self, 
#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_info = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start_call (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_info,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, 2636, __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, 2636, __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, "start_call", 0) < (0)) __PYX_ERR(0, 2636, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("start_call", 1, 1, 1, i); __PYX_ERR(0, 2636, __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, 2636, __pyx_L3_error)
    }
    __pyx_v_info = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start_call", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2636, __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("pyarrow._flight.ClientMiddlewareFactory.start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *)__pyx_v_self), __pyx_v_info);

  /* 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_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_info) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start_call", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__, "ClientMiddlewareFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddlewareF); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientMiddlewareFactory__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddlewareF); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ClientMiddlewareFactory.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddlewareFactory__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__, "ClientMiddlewareFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ClientMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *)__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_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientMiddlewareFactory__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddlewareFactory__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddlewareFactory__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ClientMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2663
 *     """
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         """A callback before headers are sent.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_1sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientMiddleware_sending_headers, "ClientMiddleware.sending_headers(self)\n\nA callback before headers are sent.\n\nReturns\n-------\nheaders : dict\n    A dictionary of header values to add to the request, or\n    None if no headers are to be added. The dictionary should\n    have string keys and string or list-of-string values.\n\n    Bytes values are allowed, but the underlying transport may\n    not support them or may restrict them. For gRPC, binary\n    values are only allowed on headers ending in \"-bin\".\n\n    Header names must be lowercase ASCII.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_1sending_headers = {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_1sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_sending_headers};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_1sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sending_headers (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("sending_headers", 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("sending_headers", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientMiddleware_sending_headers(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_sending_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sending_headers", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2681
 *         """
 * 
 *     def received_headers(self, headers):             # <<<<<<<<<<<<<<
 *         """A callback when headers are received.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_3received_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientMiddleware_2received_headers, "ClientMiddleware.received_headers(self, headers)\n\nA callback when headers are received.\n\nThe default implementation does nothing.\n\nParameters\n----------\nheaders : dict\n    A dictionary of headers from the server. Keys are strings\n    and values are lists of strings (for text headers) or\n    bytes (for binary headers).");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_3received_headers = {"received_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_3received_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_2received_headers};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_3received_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_headers = 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("received_headers (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_headers,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, 2681, __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, 2681, __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, "received_headers", 0) < (0)) __PYX_ERR(0, 2681, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("received_headers", 1, 1, 1, i); __PYX_ERR(0, 2681, __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, 2681, __pyx_L3_error)
    }
    __pyx_v_headers = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("received_headers", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2681, __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("pyarrow._flight.ClientMiddleware.received_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientMiddleware_2received_headers(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__pyx_v_self), __pyx_v_headers);

  /* 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_7pyarrow_7_flight_16ClientMiddleware_2received_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_headers) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("received_headers", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2695
 *         """
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         """A callback when the call finishes.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_5call_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientMiddleware_4call_completed, "ClientMiddleware.call_completed(self, exception)\n\nA callback when the call finishes.\n\nThe default implementation does nothing.\n\nParameters\n----------\nexception : ArrowException\n    If the call errored, this is the equivalent\n    exception. Will be None if the call succeeded.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_5call_completed = {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_5call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_4call_completed};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_5call_completed(PyObject *__pyx_v_self, 
#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_exception = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_completed (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_exception,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, 2695, __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, 2695, __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_completed", 0) < (0)) __PYX_ERR(0, 2695, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, i); __PYX_ERR(0, 2695, __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, 2695, __pyx_L3_error)
    }
    __pyx_v_exception = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2695, __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("pyarrow._flight.ClientMiddleware.call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientMiddleware_4call_completed(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__pyx_v_self), __pyx_v_exception);

  /* 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_7pyarrow_7_flight_16ClientMiddleware_4call_completed(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_completed", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2708
 *         """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef void wrap(object py_middleware,
 *                    unique_ptr[CClientMiddleware]* c_instance):
*/

static void __pyx_f_7pyarrow_7_flight_16ClientMiddleware_wrap(PyObject *__pyx_v_py_middleware, std::unique_ptr< arrow::flight::ClientMiddleware>  *__pyx_v_c_instance) {
   arrow::py::flight::PyClientMiddleware::Vtable __pyx_v_vtable;

  /* "pyarrow/_flight.pyx":2712
 *                    unique_ptr[CClientMiddleware]* c_instance):
 *         cdef PyClientMiddlewareVtable vtable
 *         vtable.sending_headers = _middleware_sending_headers             # <<<<<<<<<<<<<<
 *         vtable.received_headers = _middleware_received_headers
 *         vtable.call_completed = _middleware_call_completed
*/
  __pyx_v_vtable.sending_headers = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_sending_headers> )__pyx_f_7pyarrow_7_flight__middleware_sending_headers);

  /* "pyarrow/_flight.pyx":2713
 *         cdef PyClientMiddlewareVtable vtable
 *         vtable.sending_headers = _middleware_sending_headers
 *         vtable.received_headers = _middleware_received_headers             # <<<<<<<<<<<<<<
 *         vtable.call_completed = _middleware_call_completed
 *         c_instance[0].reset(new CPyClientMiddleware(py_middleware, vtable))
*/
  __pyx_v_vtable.received_headers = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_client_middleware_received_headers> )__pyx_f_7pyarrow_7_flight__middleware_received_headers);

  /* "pyarrow/_flight.pyx":2714
 *         vtable.sending_headers = _middleware_sending_headers
 *         vtable.received_headers = _middleware_received_headers
 *         vtable.call_completed = _middleware_call_completed             # <<<<<<<<<<<<<<
 *         c_instance[0].reset(new CPyClientMiddleware(py_middleware, vtable))
 * 
*/
  __pyx_v_vtable.call_completed = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_call_completed> )__pyx_f_7pyarrow_7_flight__middleware_call_completed);

  /* "pyarrow/_flight.pyx":2715
 *         vtable.received_headers = _middleware_received_headers
 *         vtable.call_completed = _middleware_call_completed
 *         c_instance[0].reset(new CPyClientMiddleware(py_middleware, vtable))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  (__pyx_v_c_instance[0]).reset(new  arrow::py::flight::PyClientMiddleware(__pyx_v_py_middleware, __pyx_v_vtable));

  /* "pyarrow/_flight.pyx":2708
 *         """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef void wrap(object py_middleware,
 *                    unique_ptr[CClientMiddleware]* c_instance):
*/

  /* function exit code */
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__, "ClientMiddleware.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_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_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddleware); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientMiddleware__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddleware); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ClientMiddleware.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddleware__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__, "ClientMiddleware.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_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
) {
  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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ClientMiddleware.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__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_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ClientMiddleware__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddleware__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddleware__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ClientMiddleware.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2727
 *     """
 * 
 *     def start_call(self, info, headers):             # <<<<<<<<<<<<<<
 *         """Called at the start of an RPC.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call, "ServerMiddlewareFactory.start_call(self, info, headers)\n\nCalled at the start of an RPC.\n\nThis must be thread-safe.\n\nParameters\n----------\ninfo : CallInfo\n    Information about the call.\nheaders : dict\n    A dictionary of headers from the client. Keys are strings\n    and values are lists of strings (for text headers) or\n    bytes (for binary headers).\n\nReturns\n-------\ninstance : ServerMiddleware\n    An instance of ServerMiddleware (the instance to use for\n    the call), or None if this call is not intercepted.\n\nRaises\n------\nexception : pyarrow.ArrowException\n    If an exception is raised, the call will be rejected with\n    the given error.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call = {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call(PyObject *__pyx_v_self, 
#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_info = 0;
  CYTHON_UNUSED PyObject *__pyx_v_headers = 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("start_call (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_info,&__pyx_mstate_global->__pyx_n_u_headers,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, 2727, __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, 2727, __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, 2727, __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, "start_call", 0) < (0)) __PYX_ERR(0, 2727, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("start_call", 1, 2, 2, i); __PYX_ERR(0, 2727, __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, 2727, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2727, __pyx_L3_error)
    }
    __pyx_v_info = values[0];
    __pyx_v_headers = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start_call", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2727, __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("pyarrow._flight.ServerMiddlewareFactory.start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *)__pyx_v_self), __pyx_v_info, __pyx_v_headers);

  /* 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_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_info, CYTHON_UNUSED PyObject *__pyx_v_headers) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start_call", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__, "ServerMiddlewareFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddlewareF); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerMiddlewareFactory__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddlewareF); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ServerMiddlewareFactory.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddlewareFactory__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__, "ServerMiddlewareFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ServerMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *)__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_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerMiddlewareFactory__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddlewareFactory__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddlewareFactory__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ServerMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__, "TracingServerMiddlewareFactory.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__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_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_TracingServerMidd); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_TracingServerMiddlewareFactory__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_TracingServerMidd); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.TracingServerMiddlewareFactory.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_TracingServerMiddlewareFactory__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__, "TracingServerMiddlewareFactory.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.TracingServerMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *)__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_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_TracingServerMiddlewareFactory__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_TracingServerMiddlewareFactory__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_TracingServerMiddlewareFactory__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.TracingServerMiddlewareFactory.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2780
 *     """
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         """A callback before headers are sent.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_1sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerMiddleware_sending_headers, "ServerMiddleware.sending_headers(self)\n\nA callback before headers are sent.\n\nReturns\n-------\nheaders : dict\n    A dictionary of header values to add to the response, or\n    None if no headers are to be added. The dictionary should\n    have string keys and string or list-of-string values.\n\n    Bytes values are allowed, but the underlying transport may\n    not support them or may restrict them. For gRPC, binary\n    values are only allowed on headers ending in \"-bin\".\n\n    Header names must be lowercase ASCII.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_1sending_headers = {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_1sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_sending_headers};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_1sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sending_headers (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("sending_headers", 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("sending_headers", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerMiddleware_sending_headers(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_sending_headers(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sending_headers", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2798
 *         """
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         """A callback when the call finishes.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_3call_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerMiddleware_2call_completed, "ServerMiddleware.call_completed(self, exception)\n\nA callback when the call finishes.\n\nParameters\n----------\nexception : pyarrow.ArrowException\n    If the call errored, this is the equivalent\n    exception. Will be None if the call succeeded.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_3call_completed = {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_3call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_2call_completed};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_3call_completed(PyObject *__pyx_v_self, 
#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_exception = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_completed (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_exception,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, 2798, __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, 2798, __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_completed", 0) < (0)) __PYX_ERR(0, 2798, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, i); __PYX_ERR(0, 2798, __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, 2798, __pyx_L3_error)
    }
    __pyx_v_exception = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2798, __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("pyarrow._flight.ServerMiddleware.call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerMiddleware_2call_completed(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)__pyx_v_self), __pyx_v_exception);

  /* 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_7pyarrow_7_flight_16ServerMiddleware_2call_completed(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exception) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_completed", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2809
 *         """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef void wrap(object py_middleware,
 *                    shared_ptr[CServerMiddleware]* c_instance):
*/

static void __pyx_f_7pyarrow_7_flight_16ServerMiddleware_wrap(PyObject *__pyx_v_py_middleware, std::shared_ptr< arrow::flight::ServerMiddleware>  *__pyx_v_c_instance) {
   arrow::py::flight::PyServerMiddleware::Vtable __pyx_v_vtable;

  /* "pyarrow/_flight.pyx":2813
 *                    shared_ptr[CServerMiddleware]* c_instance):
 *         cdef PyServerMiddlewareVtable vtable
 *         vtable.sending_headers = _middleware_sending_headers             # <<<<<<<<<<<<<<
 *         vtable.call_completed = _middleware_call_completed
 *         c_instance[0].reset(new CPyServerMiddleware(py_middleware, vtable))
*/
  __pyx_v_vtable.sending_headers = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_sending_headers> )__pyx_f_7pyarrow_7_flight__middleware_sending_headers);

  /* "pyarrow/_flight.pyx":2814
 *         cdef PyServerMiddlewareVtable vtable
 *         vtable.sending_headers = _middleware_sending_headers
 *         vtable.call_completed = _middleware_call_completed             # <<<<<<<<<<<<<<
 *         c_instance[0].reset(new CPyServerMiddleware(py_middleware, vtable))
 * 
*/
  __pyx_v_vtable.call_completed = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_middleware_call_completed> )__pyx_f_7pyarrow_7_flight__middleware_call_completed);

  /* "pyarrow/_flight.pyx":2815
 *         vtable.sending_headers = _middleware_sending_headers
 *         vtable.call_completed = _middleware_call_completed
 *         c_instance[0].reset(new CPyServerMiddleware(py_middleware, vtable))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  (__pyx_v_c_instance[0]).reset(new  arrow::py::flight::PyServerMiddleware(__pyx_v_py_middleware, __pyx_v_vtable));

  /* "pyarrow/_flight.pyx":2809
 *         """
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     cdef void wrap(object py_middleware,
 *                    shared_ptr[CServerMiddleware]* c_instance):
*/

  /* function exit code */
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__, "ServerMiddleware.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
  __pyx_v_state = __pyx_mstate_global->__pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, None), state
*/
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddleware); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerMiddleware__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddleware); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_238750788) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight.ServerMiddleware.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddleware__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__, "ServerMiddleware.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight.ServerMiddleware.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)__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_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ServerMiddleware__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddleware__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddleware__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight.ServerMiddleware.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2821
 *     __slots__ = ["trace_context"]
 * 
 *     def __init__(self, trace_context):             # <<<<<<<<<<<<<<
 *         self.trace_context = trace_context
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23TracingServerMiddleware_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_23TracingServerMiddleware___init__, "TracingServerMiddleware.__init__(self, trace_context)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23TracingServerMiddleware_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23TracingServerMiddleware_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23TracingServerMiddleware___init__};
static PyObject *__pyx_pw_7pyarrow_7_flight_23TracingServerMiddleware_1__init__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_trace_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_self,&__pyx_mstate_global->__pyx_n_u_trace_context,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, 2821, __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, 2821, __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, 2821, __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, 2821, __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, 2821, __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, 2821, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2821, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
    __pyx_v_trace_context = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2821, __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("pyarrow._flight.TracingServerMiddleware.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_23TracingServerMiddleware___init__(__pyx_self, __pyx_v_self, __pyx_v_trace_context);

  /* 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_7pyarrow_7_flight_23TracingServerMiddleware___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_trace_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":2822
 * 
 *     def __init__(self, trace_context):
 *         self.trace_context = trace_context             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_trace_context, __pyx_v_trace_context) < (0)) __PYX_ERR(0, 2822, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2821
 *     __slots__ = ["trace_context"]
 * 
 *     def __init__(self, trace_context):             # <<<<<<<<<<<<<<
 *         self.trace_context = trace_context
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.TracingServerMiddleware.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2831
 *         dict factories
 * 
 *     def __init__(self, dict factories):             # <<<<<<<<<<<<<<
 *         self.factories = factories
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_factories = 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_factories,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, 2831, __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, 2831, __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, 2831, __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, 2831, __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, 2831, __pyx_L3_error)
    }
    __pyx_v_factories = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2831, __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("pyarrow._flight._ServerMiddlewareFactoryWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_factories), (&PyDict_Type), 1, "factories", 1))) __PYX_ERR(0, 2831, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper___init__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__pyx_v_self), __pyx_v_factories);

  /* 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_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper___init__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v_factories) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":2832
 * 
 *     def __init__(self, dict factories):
 *         self.factories = factories             # <<<<<<<<<<<<<<
 * 
 *     def start_call(self, info, headers):
*/
  __Pyx_INCREF(__pyx_v_factories);
  __Pyx_GIVEREF(__pyx_v_factories);
  __Pyx_GOTREF(__pyx_v_self->factories);
  __Pyx_DECREF(__pyx_v_self->factories);
  __pyx_v_self->factories = __pyx_v_factories;

  /* "pyarrow/_flight.pyx":2831
 *         dict factories
 * 
 *     def __init__(self, dict factories):             # <<<<<<<<<<<<<<
 *         self.factories = factories
 * 
*/

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

/* "pyarrow/_flight.pyx":2834
 *         self.factories = factories
 * 
 *     def start_call(self, info, headers):             # <<<<<<<<<<<<<<
 *         instances = {}
 *         for key, factory in self.factories.items():
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call, "_ServerMiddlewareFactoryWrapper.start_call(self, info, headers)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call = {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call};
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call(PyObject *__pyx_v_self, 
#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_info = 0;
  PyObject *__pyx_v_headers = 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("start_call (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_info,&__pyx_mstate_global->__pyx_n_u_headers,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, 2834, __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, 2834, __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, 2834, __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, "start_call", 0) < (0)) __PYX_ERR(0, 2834, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("start_call", 1, 2, 2, i); __PYX_ERR(0, 2834, __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, 2834, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2834, __pyx_L3_error)
    }
    __pyx_v_info = values[0];
    __pyx_v_headers = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start_call", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2834, __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("pyarrow._flight._ServerMiddlewareFactoryWrapper.start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__pyx_v_self), __pyx_v_info, __pyx_v_headers);

  /* 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_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v_info, PyObject *__pyx_v_headers) {
  PyObject *__pyx_v_instances = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_factory = NULL;
  PyObject *__pyx_v_instance = NULL;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_wrapper = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  size_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start_call", 0);

  /* "pyarrow/_flight.pyx":2835
 * 
 *     def start_call(self, info, headers):
 *         instances = {}             # <<<<<<<<<<<<<<
 *         for key, factory in self.factories.items():
 *             instance = factory.start_call(info, headers)
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_instances = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2836
 *     def start_call(self, info, headers):
 *         instances = {}
 *         for key, factory in self.factories.items():             # <<<<<<<<<<<<<<
 *             instance = factory.start_call(info, headers)
 *             if instance:
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_self->factories == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 2836, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->factories, 1, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 2836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_factory, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/_flight.pyx":2837
 *         instances = {}
 *         for key, factory in self.factories.items():
 *             instance = factory.start_call(info, headers)             # <<<<<<<<<<<<<<
 *             if instance:
 *                 instances[key] = instance
*/
    __pyx_t_5 = __pyx_v_factory;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_info, __pyx_v_headers};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start_call, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2837, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "pyarrow/_flight.pyx":2838
 *         for key, factory in self.factories.items():
 *             instance = factory.start_call(info, headers)
 *             if instance:             # <<<<<<<<<<<<<<
 *                 instances[key] = instance
 *         if instances:
*/
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_instance); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2838, __pyx_L1_error)
    if (__pyx_t_9) {

      /* "pyarrow/_flight.pyx":2839
 *             instance = factory.start_call(info, headers)
 *             if instance:
 *                 instances[key] = instance             # <<<<<<<<<<<<<<
 *         if instances:
 *             wrapper = _ServerMiddlewareWrapper(instances)
*/
      if (unlikely((PyDict_SetItem(__pyx_v_instances, __pyx_v_key, __pyx_v_instance) < 0))) __PYX_ERR(0, 2839, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2838
 *         for key, factory in self.factories.items():
 *             instance = factory.start_call(info, headers)
 *             if instance:             # <<<<<<<<<<<<<<
 *                 instances[key] = instance
 *         if instances:
*/
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2840
 *             if instance:
 *                 instances[key] = instance
 *         if instances:             # <<<<<<<<<<<<<<
 *             wrapper = _ServerMiddlewareWrapper(instances)
 *             return wrapper
*/
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_instances); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2840, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "pyarrow/_flight.pyx":2841
 *                 instances[key] = instance
 *         if instances:
 *             wrapper = _ServerMiddlewareWrapper(instances)             # <<<<<<<<<<<<<<
 *             return wrapper
 *         return None
*/
    __pyx_t_6 = NULL;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_instances};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __pyx_v_wrapper = ((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyarrow/_flight.pyx":2842
 *         if instances:
 *             wrapper = _ServerMiddlewareWrapper(instances)
 *             return wrapper             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_wrapper);
    __pyx_r = ((PyObject *)__pyx_v_wrapper);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":2840
 *             if instance:
 *                 instances[key] = instance
 *         if instances:             # <<<<<<<<<<<<<<
 *             wrapper = _ServerMiddlewareWrapper(instances)
 *             return wrapper
*/
  }

  /* "pyarrow/_flight.pyx":2843
 *             wrapper = _ServerMiddlewareWrapper(instances)
 *             return wrapper
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2834
 *         self.factories = factories
 * 
 *     def start_call(self, info, headers):             # <<<<<<<<<<<<<<
 *         instances = {}
 *         for key, factory in self.factories.items():
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareFactoryWrapper.start_call", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_instances);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_factory);
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XDECREF((PyObject *)__pyx_v_wrapper);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__, "_ServerMiddlewareFactoryWrapper.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.factories,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->factories);
  __Pyx_GIVEREF(__pyx_v_self->factories);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->factories) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.factories,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.factories,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.factories is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.factories,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.factories is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, None), state
*/
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->factories != ((PyObject*)Py_None));
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.factories is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.factories is not None
 *     if use_setstate:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_235806214);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_235806214);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_235806214) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.factories is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, None), state
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_235806214);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_235806214);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_235806214) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareFactoryWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__, "_ServerMiddlewareFactoryWrapper.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight._ServerMiddlewareFactoryWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__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_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareFactoryWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2850
 *         dict middleware
 * 
 *     def __init__(self, dict middleware):             # <<<<<<<<<<<<<<
 *         self.middleware = middleware
 * 
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_middleware = 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_middleware,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, 2850, __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, 2850, __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, 2850, __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, 2850, __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, 2850, __pyx_L3_error)
    }
    __pyx_v_middleware = ((PyObject*)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2850, __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("pyarrow._flight._ServerMiddlewareWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_middleware), (&PyDict_Type), 1, "middleware", 1))) __PYX_ERR(0, 2850, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper___init__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_v_self), __pyx_v_middleware);

  /* 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_7pyarrow_7_flight_24_ServerMiddlewareWrapper___init__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v_middleware) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/_flight.pyx":2851
 * 
 *     def __init__(self, dict middleware):
 *         self.middleware = middleware             # <<<<<<<<<<<<<<
 * 
 *     def sending_headers(self):
*/
  __Pyx_INCREF(__pyx_v_middleware);
  __Pyx_GIVEREF(__pyx_v_middleware);
  __Pyx_GOTREF(__pyx_v_self->middleware);
  __Pyx_DECREF(__pyx_v_self->middleware);
  __pyx_v_self->middleware = __pyx_v_middleware;

  /* "pyarrow/_flight.pyx":2850
 *         dict middleware
 * 
 *     def __init__(self, dict middleware):             # <<<<<<<<<<<<<<
 *         self.middleware = middleware
 * 
*/

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

/* "pyarrow/_flight.pyx":2853
 *         self.middleware = middleware
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         headers = collections.defaultdict(list)
 *         for instance in self.middleware.values():
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers, "_ServerMiddlewareWrapper.sending_headers(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers = {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers};
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sending_headers (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("sending_headers", 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("sending_headers", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self) {
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_instance = NULL;
  PyObject *__pyx_v_more_headers = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sending_headers", 0);

  /* "pyarrow/_flight.pyx":2854
 * 
 *     def sending_headers(self):
 *         headers = collections.defaultdict(list)             # <<<<<<<<<<<<<<
 *         for instance in self.middleware.values():
 *             more_headers = instance.sending_headers()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_defaultdict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2854, __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, ((PyObject *)(&PyList_Type))};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 2854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_headers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2855
 *     def sending_headers(self):
 *         headers = collections.defaultdict(list)
 *         for instance in self.middleware.values():             # <<<<<<<<<<<<<<
 *             more_headers = instance.sending_headers()
 *             if not more_headers:
*/
  __pyx_t_6 = 0;
  if (unlikely(__pyx_v_self->middleware == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(0, 2855, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->middleware, 1, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_4;
  __pyx_t_4 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_7, &__pyx_t_6, NULL, &__pyx_t_4, NULL, __pyx_t_8);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":2856
 *         headers = collections.defaultdict(list)
 *         for instance in self.middleware.values():
 *             more_headers = instance.sending_headers()             # <<<<<<<<<<<<<<
 *             if not more_headers:
 *                 continue
*/
    __pyx_t_2 = __pyx_v_instance;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_sending_headers, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_more_headers, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":2857
 *         for instance in self.middleware.values():
 *             more_headers = instance.sending_headers()
 *             if not more_headers:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Manually merge with existing headers (since headers are
*/
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_more_headers); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2857, __pyx_L1_error)
    __pyx_t_11 = (!__pyx_t_10);
    if (__pyx_t_11) {

      /* "pyarrow/_flight.pyx":2858
 *             more_headers = instance.sending_headers()
 *             if not more_headers:
 *                 continue             # <<<<<<<<<<<<<<
 *             # Manually merge with existing headers (since headers are
 *             # multi-valued)
*/
      goto __pyx_L3_continue;

      /* "pyarrow/_flight.pyx":2857
 *         for instance in self.middleware.values():
 *             more_headers = instance.sending_headers()
 *             if not more_headers:             # <<<<<<<<<<<<<<
 *                 continue
 *             # Manually merge with existing headers (since headers are
*/
    }

    /* "pyarrow/_flight.pyx":2861
 *             # Manually merge with existing headers (since headers are
 *             # multi-valued)
 *             for key, values in more_headers.items():             # <<<<<<<<<<<<<<
 *                 # ARROW-16606 gRPC aborts given non-lowercase headers
 *                 key = key.lower()
*/
    __pyx_t_12 = 0;
    if (unlikely(__pyx_v_more_headers == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 2861, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_more_headers, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_13), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_4);
    __pyx_t_4 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_13, &__pyx_t_12, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_14 == 0)) break;
      if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 2861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/_flight.pyx":2863
 *             for key, values in more_headers.items():
 *                 # ARROW-16606 gRPC aborts given non-lowercase headers
 *                 key = key.lower()             # <<<<<<<<<<<<<<
 *                 if isinstance(values, (bytes, str)):
 *                     values = (values,)
*/
      __pyx_t_2 = __pyx_v_key;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2863, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "pyarrow/_flight.pyx":2864
 *                 # ARROW-16606 gRPC aborts given non-lowercase headers
 *                 key = key.lower()
 *                 if isinstance(values, (bytes, str)):             # <<<<<<<<<<<<<<
 *                     values = (values,)
 *                 headers[key].extend(values)
*/
      __pyx_t_10 = PyBytes_Check(__pyx_v_values); 
      if (!__pyx_t_10) {
      } else {
        __pyx_t_11 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = PyUnicode_Check(__pyx_v_values); 
      __pyx_t_11 = __pyx_t_10;
      __pyx_L9_bool_binop_done:;
      if (__pyx_t_11) {

        /* "pyarrow/_flight.pyx":2865
 *                 key = key.lower()
 *                 if isinstance(values, (bytes, str)):
 *                     values = (values,)             # <<<<<<<<<<<<<<
 *                 headers[key].extend(values)
 *         return headers
*/
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2865, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_v_values);
        __Pyx_GIVEREF(__pyx_v_values);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values) != (0)) __PYX_ERR(0, 2865, __pyx_L1_error);
        __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/_flight.pyx":2864
 *                 # ARROW-16606 gRPC aborts given non-lowercase headers
 *                 key = key.lower()
 *                 if isinstance(values, (bytes, str)):             # <<<<<<<<<<<<<<
 *                     values = (values,)
 *                 headers[key].extend(values)
*/
      }

      /* "pyarrow/_flight.pyx":2866
 *                 if isinstance(values, (bytes, str)):
 *                     values = (values,)
 *                 headers[key].extend(values)             # <<<<<<<<<<<<<<
 *         return headers
 * 
*/
      __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_v_headers, __pyx_v_key); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_2 = __pyx_t_15;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_values};
        __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2866, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2867
 *                     values = (values,)
 *                 headers[key].extend(values)
 *         return headers             # <<<<<<<<<<<<<<
 * 
 *     def call_completed(self, exception):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_headers);
  __pyx_r = __pyx_v_headers;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":2853
 *         self.middleware = middleware
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         headers = collections.defaultdict(list)
 *         for instance in self.middleware.values():
*/

  /* 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_15);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareWrapper.sending_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XDECREF(__pyx_v_more_headers);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2869
 *         return headers
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         for instance in self.middleware.values():
 *             instance.call_completed(exception)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed, "_ServerMiddlewareWrapper.call_completed(self, exception)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed = {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed};
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_exception = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("call_completed (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_exception,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, 2869, __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, 2869, __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_completed", 0) < (0)) __PYX_ERR(0, 2869, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, i); __PYX_ERR(0, 2869, __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, 2869, __pyx_L3_error)
    }
    __pyx_v_exception = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("call_completed", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2869, __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("pyarrow._flight._ServerMiddlewareWrapper.call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_v_self), __pyx_v_exception);

  /* 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_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v_exception) {
  PyObject *__pyx_v_instance = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __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("call_completed", 0);

  /* "pyarrow/_flight.pyx":2870
 * 
 *     def call_completed(self, exception):
 *         for instance in self.middleware.values():             # <<<<<<<<<<<<<<
 *             instance.call_completed(exception)
 * 
*/
  __pyx_t_2 = 0;
  if (unlikely(__pyx_v_self->middleware == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(0, 2870, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_self->middleware, 1, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_6 == 0)) break;
    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_instance, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2871
 *     def call_completed(self, exception):
 *         for instance in self.middleware.values():
 *             instance.call_completed(exception)             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_7 = __pyx_v_instance;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_8 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_exception};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_call_completed, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":2869
 *         return headers
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         for instance in self.middleware.values():
 *             instance.call_completed(exception)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareWrapper.call_completed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_instance);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__, "_ServerMiddlewareWrapper.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_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_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.middleware,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->middleware);
  __Pyx_GIVEREF(__pyx_v_self->middleware);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->middleware) != (0)) __PYX_ERR(1, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.middleware,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.middleware,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.middleware is not None
*/
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.middleware,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.middleware is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, None), state
*/
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->middleware != ((PyObject*)Py_None));
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.middleware is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, None), state
 *     else:
*/
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.middleware is not None
 *     if use_setstate:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)
*/
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_265810548);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_265810548);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_265810548) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __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(1, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.middleware is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, None), state
 *     else:
*/
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, None), state
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__ServerMiddlewareWrapper__set_state(self, __pyx_state)
*/
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_265810548);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_265810548);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_265810548) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareWrapper.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareWrapper__set_state(self, __pyx_state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__, "_ServerMiddlewareWrapper.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_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
) {
  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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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, 16, __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("pyarrow._flight._ServerMiddlewareWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__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_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle__ServerMiddlewareWrapper__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(1, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareWrapper__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareWrapper__set_state(self, __pyx_state)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyarrow._flight._ServerMiddlewareWrapper.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2885
 *         shared_ptr[PyFlightServer] server
 * 
 *     def finalize(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyFlightServer* server = self.server.get()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_finalize, "_FlightServerFinalizer.finalize(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize = {"finalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_finalize};
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize(PyObject *__pyx_v_self, 
#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("finalize (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("finalize", 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("finalize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_finalize(((struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_finalize(struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__pyx_v_self) {
  arrow::py::flight::PyFlightServer *__pyx_v_server;
  arrow::Status __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  char const *__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;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("finalize", 0);

  /* "pyarrow/_flight.pyx":2887
 *     def finalize(self):
 *         cdef:
 *             PyFlightServer* server = self.server.get()             # <<<<<<<<<<<<<<
 *             CStatus status
 *         if server == NULL:
*/
  __pyx_v_server = __pyx_v_self->server.get();

  /* "pyarrow/_flight.pyx":2889
 *             PyFlightServer* server = self.server.get()
 *             CStatus status
 *         if server == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         try:
*/
  __pyx_t_1 = (__pyx_v_server == NULL);
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":2890
 *             CStatus status
 *         if server == NULL:
 *             return             # <<<<<<<<<<<<<<
 *         try:
 *             with nogil:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/_flight.pyx":2889
 *             PyFlightServer* server = self.server.get()
 *             CStatus status
 *         if server == NULL:             # <<<<<<<<<<<<<<
 *             return
 *         try:
*/
  }

  /* "pyarrow/_flight.pyx":2891
 *         if server == NULL:
 *             return
 *         try:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 status = server.Shutdown()
*/
  /*try:*/ {

    /* "pyarrow/_flight.pyx":2892
 *             return
 *         try:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 status = server.Shutdown()
 *                 if status.ok():
*/
    {
        PyThreadState * _save;
        _save = PyEval_SaveThread();
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pyarrow/_flight.pyx":2893
 *         try:
 *             with nogil:
 *                 status = server.Shutdown()             # <<<<<<<<<<<<<<
 *                 if status.ok():
 *                     status = server.Wait()
*/
          __pyx_v_status = __pyx_v_server->Shutdown();

          /* "pyarrow/_flight.pyx":2894
 *             with nogil:
 *                 status = server.Shutdown()
 *                 if status.ok():             # <<<<<<<<<<<<<<
 *                     status = server.Wait()
 *             check_flight_status(status)
*/
          __pyx_t_1 = (__pyx_v_status.ok() != 0);
          if (__pyx_t_1) {

            /* "pyarrow/_flight.pyx":2895
 *                 status = server.Shutdown()
 *                 if status.ok():
 *                     status = server.Wait()             # <<<<<<<<<<<<<<
 *             check_flight_status(status)
 *         finally:
*/
            __pyx_v_status = __pyx_v_server->Wait();

            /* "pyarrow/_flight.pyx":2894
 *             with nogil:
 *                 status = server.Shutdown()
 *                 if status.ok():             # <<<<<<<<<<<<<<
 *                     status = server.Wait()
 *             check_flight_status(status)
*/
          }
        }

        /* "pyarrow/_flight.pyx":2892
 *             return
 *         try:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 status = server.Shutdown()
 *                 if status.ok():
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            PyEval_RestoreThread(_save);
            goto __pyx_L9;
          }
          __pyx_L9:;
        }
    }

    /* "pyarrow/_flight.pyx":2896
 *                 if status.ok():
 *                     status = server.Wait()
 *             check_flight_status(status)             # <<<<<<<<<<<<<<
 *         finally:
 *             self.server.reset()
*/
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_status); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2896, __pyx_L5_error)
  }

  /* "pyarrow/_flight.pyx":2898
 *             check_flight_status(status)
 *         finally:
 *             self.server.reset()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_v_self->server.reset();
      goto __pyx_L6;
    }
    __pyx_L5_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename;
      {
        __pyx_v_self->server.reset();
      }
      __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);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4;
      goto __pyx_L1_error;
    }
    __pyx_L6:;
  }

  /* "pyarrow/_flight.pyx":2885
 *         shared_ptr[PyFlightServer] server
 * 
 *     def finalize(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyFlightServer* server = self.server.get()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight._FlightServerFinalizer.finalize", __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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__, "_FlightServerFinalizer.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_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_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__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.server cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_server_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight._FlightServerFinalizer.__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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__, "_FlightServerFinalizer.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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("pyarrow._flight._FlightServerFinalizer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)__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_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_server_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":2938
 *         object finalizer
 * 
 *     def __init__(self, location=None, auth_handler=None,             # <<<<<<<<<<<<<<
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):
*/

/* Python wrapper */
static int __pyx_pw_7pyarrow_7_flight_16FlightServerBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_7_flight_16FlightServerBase_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_location = 0;
  PyObject *__pyx_v_auth_handler = 0;
  PyObject *__pyx_v_tls_certificates = 0;
  PyObject *__pyx_v_verify_client = 0;
  PyObject *__pyx_v_root_certificates = 0;
  PyObject *__pyx_v_middleware = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  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;
  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_location,&__pyx_mstate_global->__pyx_n_u_auth_handler,&__pyx_mstate_global->__pyx_n_u_tls_certificates,&__pyx_mstate_global->__pyx_n_u_verify_client,&__pyx_mstate_global->__pyx_n_u_root_certificates,&__pyx_mstate_global->__pyx_n_u_middleware,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, 2938, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2938, __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, 2938, __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, 2938, __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, 2938, __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, 2938, __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, 2938, __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, 2938, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":2939
 * 
 *     def __init__(self, location=None, auth_handler=None,
 *                  tls_certificates=None, verify_client=None,             # <<<<<<<<<<<<<<
 *                  root_certificates=None, middleware=None):
 *         self.finalizer = None
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":2940
 *     def __init__(self, location=None, auth_handler=None,
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):             # <<<<<<<<<<<<<<
 *         self.finalizer = None
 *         if isinstance(location, (bytes, str)):
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2938, __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, 2938, __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, 2938, __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, 2938, __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, 2938, __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, 2938, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pyarrow/_flight.pyx":2938
 *         object finalizer
 * 
 *     def __init__(self, location=None, auth_handler=None,             # <<<<<<<<<<<<<<
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":2939
 * 
 *     def __init__(self, location=None, auth_handler=None,
 *                  tls_certificates=None, verify_client=None,             # <<<<<<<<<<<<<<
 *                  root_certificates=None, middleware=None):
 *         self.finalizer = None
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "pyarrow/_flight.pyx":2940
 *     def __init__(self, location=None, auth_handler=None,
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):             # <<<<<<<<<<<<<<
 *         self.finalizer = None
 *         if isinstance(location, (bytes, str)):
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_location = values[0];
    __pyx_v_auth_handler = values[1];
    __pyx_v_tls_certificates = values[2];
    __pyx_v_verify_client = values[3];
    __pyx_v_root_certificates = values[4];
    __pyx_v_middleware = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 2938, __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("pyarrow._flight.FlightServerBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase___init__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_location, __pyx_v_auth_handler, __pyx_v_tls_certificates, __pyx_v_verify_client, __pyx_v_root_certificates, __pyx_v_middleware);

  /* "pyarrow/_flight.pyx":2938
 *         object finalizer
 * 
 *     def __init__(self, location=None, auth_handler=None,             # <<<<<<<<<<<<<<
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):
*/

  /* 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_7pyarrow_7_flight_16FlightServerBase___init__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, PyObject *__pyx_v_location, PyObject *__pyx_v_auth_handler, PyObject *__pyx_v_tls_certificates, PyObject *__pyx_v_verify_client, PyObject *__pyx_v_root_certificates, PyObject *__pyx_v_middleware) {
  PyObject *__pyx_v_host = NULL;
  PyObject *__pyx_v_port = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  bool __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_location);

  /* "pyarrow/_flight.pyx":2941
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):
 *         self.finalizer = None             # <<<<<<<<<<<<<<
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
*/
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->finalizer);
  __Pyx_DECREF(__pyx_v_self->finalizer);
  __pyx_v_self->finalizer = Py_None;

  /* "pyarrow/_flight.pyx":2942
 *                  root_certificates=None, middleware=None):
 *         self.finalizer = None
 *         if isinstance(location, (bytes, str)):             # <<<<<<<<<<<<<<
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):
*/
  __pyx_t_2 = PyBytes_Check(__pyx_v_location); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyUnicode_Check(__pyx_v_location); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":2943
 *         self.finalizer = None
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)             # <<<<<<<<<<<<<<
 *         elif isinstance(location, (tuple, type(None))):
 *             if location is None:
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_location};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __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;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_location, ((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/_flight.pyx":2942
 *                  root_certificates=None, middleware=None):
 *         self.finalizer = None
 *         if isinstance(location, (bytes, str)):             # <<<<<<<<<<<<<<
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":2944
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):             # <<<<<<<<<<<<<<
 *             if location is None:
 *                 location = ('localhost', 0)
*/
  __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
  __pyx_t_3 = ((PyObject *)Py_TYPE(Py_None));
  __pyx_t_2 = PyTuple_Check(__pyx_v_location); 
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_location, __pyx_t_3); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":2945
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):
 *             if location is None:             # <<<<<<<<<<<<<<
 *                 location = ('localhost', 0)
 *             host, port = location
*/
    __pyx_t_1 = (__pyx_v_location == Py_None);
    if (__pyx_t_1) {

      /* "pyarrow/_flight.pyx":2946
 *         elif isinstance(location, (tuple, type(None))):
 *             if location is None:
 *                 location = ('localhost', 0)             # <<<<<<<<<<<<<<
 *             host, port = location
 *             if tls_certificates:
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[4]);
      __Pyx_DECREF_SET(__pyx_v_location, __pyx_mstate_global->__pyx_tuple[4]);

      /* "pyarrow/_flight.pyx":2945
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):
 *             if location is None:             # <<<<<<<<<<<<<<
 *                 location = ('localhost', 0)
 *             host, port = location
*/
    }

    /* "pyarrow/_flight.pyx":2947
 *             if location is None:
 *                 location = ('localhost', 0)
 *             host, port = location             # <<<<<<<<<<<<<<
 *             if tls_certificates:
 *                 location = Location.for_grpc_tls(host, port)
*/
    if ((likely(PyTuple_CheckExact(__pyx_v_location))) || (PyList_CheckExact(__pyx_v_location))) {
      PyObject* sequence = __pyx_v_location;
      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, 2947, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2947, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2947, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_location); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 2947, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2947, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __pyx_v_host = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_port = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/_flight.pyx":2948
 *                 location = ('localhost', 0)
 *             host, port = location
 *             if tls_certificates:             # <<<<<<<<<<<<<<
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
*/
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_tls_certificates); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2948, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "pyarrow/_flight.pyx":2949
 *             host, port = location
 *             if tls_certificates:
 *                 location = Location.for_grpc_tls(host, port)             # <<<<<<<<<<<<<<
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
*/
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_host, __pyx_v_port};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_for_grpc_tls, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2949, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_location, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/_flight.pyx":2948
 *                 location = ('localhost', 0)
 *             host, port = location
 *             if tls_certificates:             # <<<<<<<<<<<<<<
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
*/
      goto __pyx_L11;
    }

    /* "pyarrow/_flight.pyx":2951
 *                 location = Location.for_grpc_tls(host, port)
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)             # <<<<<<<<<<<<<<
 *         elif not isinstance(location, Location):
 *             raise TypeError('`location` argument must be a string, tuple or a '
*/
    /*else*/ {
      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_host, __pyx_v_port};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_for_grpc_tcp, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_location, __pyx_t_4);
      __pyx_t_4 = 0;
    }
    __pyx_L11:;

    /* "pyarrow/_flight.pyx":2944
 *         if isinstance(location, (bytes, str)):
 *             location = Location(location)
 *         elif isinstance(location, (tuple, type(None))):             # <<<<<<<<<<<<<<
 *             if location is None:
 *                 location = ('localhost', 0)
*/
    goto __pyx_L3;
  }

  /* "pyarrow/_flight.pyx":2952
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location); 
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/_flight.pyx":2953
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):
 *             raise TypeError('`location` argument must be a string, tuple or a '             # <<<<<<<<<<<<<<
 *                             'Location instance')
 *         self.init(location, auth_handler, tls_certificates, verify_client,
*/
    __pyx_t_3 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_location_argument_must_be_a_str};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __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;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2953, __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, 2953, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2952
 *             else:
 *                 location = Location.for_grpc_tcp(host, port)
 *         elif not isinstance(location, Location):             # <<<<<<<<<<<<<<
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
*/
  }
  __pyx_L3:;

  /* "pyarrow/_flight.pyx":2955
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
 *         self.init(location, auth_handler, tls_certificates, verify_client,             # <<<<<<<<<<<<<<
 *                   tobytes(root_certificates or b""), middleware)
 * 
*/
  if (!(likely(((__pyx_v_location) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_location, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location))))) __PYX_ERR(0, 2955, __pyx_L1_error)
  if (!(likely(((__pyx_v_auth_handler) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_auth_handler, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler))))) __PYX_ERR(0, 2955, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_tls_certificates;
  __Pyx_INCREF(__pyx_t_4);
  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_4))) __PYX_ERR(0, 2955, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verify_client); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2955, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2956
 *                             'Location instance')
 *         self.init(location, auth_handler, tls_certificates, verify_client,
 *                   tobytes(root_certificates or b""), middleware)             # <<<<<<<<<<<<<<
 * 
 *     cdef init(self, Location location, ServerAuthHandler auth_handler,
*/
  __pyx_t_6 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_root_certificates); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2956, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_v_root_certificates);
    __pyx_t_10 = __pyx_v_root_certificates;
    goto __pyx_L12_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
  __pyx_t_10 = __pyx_mstate_global->__pyx_kp_b__5;
  __pyx_L12_bool_binop_done:;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_10};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(0, 2956, __pyx_L1_error)
  __pyx_t_9 = __pyx_v_middleware;
  __Pyx_INCREF(__pyx_t_9);
  if (!(likely(PyDict_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_9))) __PYX_ERR(0, 2956, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":2955
 *             raise TypeError('`location` argument must be a string, tuple or a '
 *                             'Location instance')
 *         self.init(location, auth_handler, tls_certificates, verify_client,             # <<<<<<<<<<<<<<
 *                   tobytes(root_certificates or b""), middleware)
 * 
*/
  __pyx_t_10 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self->__pyx_vtab)->init(__pyx_v_self, ((struct __pyx_obj_7pyarrow_7_flight_Location *)__pyx_v_location), ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_auth_handler), ((PyObject*)__pyx_t_4), __pyx_t_8, ((PyObject*)__pyx_t_3), ((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "pyarrow/_flight.pyx":2938
 *         object finalizer
 * 
 *     def __init__(self, location=None, auth_handler=None,             # <<<<<<<<<<<<<<
 *                  tls_certificates=None, verify_client=None,
 *                  root_certificates=None, middleware=None):
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_host);
  __Pyx_XDECREF(__pyx_v_port);
  __Pyx_XDECREF(__pyx_v_location);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":2958
 *                   tobytes(root_certificates or b""), middleware)
 * 
 *     cdef init(self, Location location, ServerAuthHandler auth_handler,             # <<<<<<<<<<<<<<
 *               list tls_certificates, c_bool verify_client,
 *               bytes root_certificates, dict middleware):
*/

static PyObject *__pyx_f_7pyarrow_7_flight_16FlightServerBase_init(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, struct __pyx_obj_7pyarrow_7_flight_Location *__pyx_v_location, struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v_auth_handler, PyObject *__pyx_v_tls_certificates, bool __pyx_v_verify_client, PyObject *__pyx_v_root_certificates, PyObject *__pyx_v_middleware) {
  arrow::py::flight::PyFlightServerVtable __pyx_v_vtable;
  arrow::py::flight::PyFlightServer *__pyx_v_c_server;
  std::unique_ptr< arrow::flight::FlightServerOptions>  __pyx_v_c_options;
   arrow::flight::CertKeyPair __pyx_v_c_cert;
  std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_server_middleware_start_call>  __pyx_v_start_call;
  std::pair<std::string,std::shared_ptr< arrow::flight::ServerMiddlewareFactory> >  __pyx_v_c_middleware;
  PyObject *__pyx_v_cert = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_non_tracing_middleware = NULL;
  PyObject *__pyx_v_enable_tracing = NULL;
  PyObject *__pyx_v_factory = NULL;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v_py_middleware = NULL;
  struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *__pyx_v_finalizer = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::flight::Location __pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[3];
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
   arrow::py::flight::PyServerAuthHandler *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  std::shared_ptr<arrow::py::flight::PyFlightServer>  __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/_flight.pyx":2962
 *               bytes root_certificates, dict middleware):
 *         cdef:
 *             PyFlightServerVtable vtable = PyFlightServerVtable()             # <<<<<<<<<<<<<<
 *             PyFlightServer* c_server
 *             unique_ptr[CFlightServerOptions] c_options
*/
  __pyx_v_vtable = arrow::py::flight::PyFlightServerVtable();

  /* "pyarrow/_flight.pyx":2967
 *             CCertKeyPair c_cert
 *             function[cb_server_middleware_start_call] start_call = \
 *                 &_server_middleware_start_call             # <<<<<<<<<<<<<<
 *             pair[c_string, shared_ptr[CServerMiddlewareFactory]] c_middleware
 * 
*/
  __pyx_v_start_call = (&__pyx_f_7pyarrow_7_flight__server_middleware_start_call);

  /* "pyarrow/_flight.pyx":2970
 *             pair[c_string, shared_ptr[CServerMiddlewareFactory]] c_middleware
 * 
 *         c_options.reset(new CFlightServerOptions(Location.unwrap(location)))             # <<<<<<<<<<<<<<
 *         # mTLS configuration
 *         c_options.get().verify_client = verify_client
*/
  __pyx_t_1 = __pyx_f_7pyarrow_7_flight_8Location_unwrap(((PyObject *)__pyx_v_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2970, __pyx_L1_error)
  __pyx_v_c_options.reset(new  arrow::flight::FlightServerOptions(__pyx_t_1));

  /* "pyarrow/_flight.pyx":2972
 *         c_options.reset(new CFlightServerOptions(Location.unwrap(location)))
 *         # mTLS configuration
 *         c_options.get().verify_client = verify_client             # <<<<<<<<<<<<<<
 *         c_options.get().root_certificates = root_certificates
 * 
*/
  __pyx_v_c_options.get()->verify_client = __pyx_v_verify_client;

  /* "pyarrow/_flight.pyx":2973
 *         # mTLS configuration
 *         c_options.get().verify_client = verify_client
 *         c_options.get().root_certificates = root_certificates             # <<<<<<<<<<<<<<
 * 
 *         if auth_handler:
*/
  __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_root_certificates); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L1_error)
  __pyx_v_c_options.get()->root_certificates = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pyarrow/_flight.pyx":2975
 *         c_options.get().root_certificates = root_certificates
 * 
 *         if auth_handler:             # <<<<<<<<<<<<<<
 *             if not isinstance(auth_handler, ServerAuthHandler):
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
*/
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_auth_handler)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 2975, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/_flight.pyx":2976
 * 
 *         if auth_handler:
 *             if not isinstance(auth_handler, ServerAuthHandler):             # <<<<<<<<<<<<<<
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
 *                                 f"not a '{type(auth_handler)}'")
*/
    __pyx_t_3 = __Pyx_TypeCheck(((PyObject *)__pyx_v_auth_handler), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler); 
    __pyx_t_4 = (!__pyx_t_3);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/_flight.pyx":2977
 *         if auth_handler:
 *             if not isinstance(auth_handler, ServerAuthHandler):
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "             # <<<<<<<<<<<<<<
 *                                 f"not a '{type(auth_handler)}'")
 *             c_options.get().auth_handler.reset(
*/
      __pyx_t_6 = NULL;

      /* "pyarrow/_flight.pyx":2978
 *             if not isinstance(auth_handler, ServerAuthHandler):
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
 *                                 f"not a '{type(auth_handler)}'")             # <<<<<<<<<<<<<<
 *             c_options.get().auth_handler.reset(
 *                 (<ServerAuthHandler> auth_handler).to_handler())
*/
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_auth_handler))), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_auth_handler_must_be_a_ServerAut;
      __pyx_t_8[1] = __pyx_t_7;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u__3;

      /* "pyarrow/_flight.pyx":2977
 *         if auth_handler:
 *             if not isinstance(auth_handler, ServerAuthHandler):
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "             # <<<<<<<<<<<<<<
 *                                 f"not a '{type(auth_handler)}'")
 *             c_options.get().auth_handler.reset(
*/
      __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, 49 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_9};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2977, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(0, 2977, __pyx_L1_error)

      /* "pyarrow/_flight.pyx":2976
 * 
 *         if auth_handler:
 *             if not isinstance(auth_handler, ServerAuthHandler):             # <<<<<<<<<<<<<<
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
 *                                 f"not a '{type(auth_handler)}'")
*/
    }

    /* "pyarrow/_flight.pyx":2980
 *                                 f"not a '{type(auth_handler)}'")
 *             c_options.get().auth_handler.reset(
 *                 (<ServerAuthHandler> auth_handler).to_handler())             # <<<<<<<<<<<<<<
 * 
 *         if tls_certificates:
*/
    __pyx_t_11 = ((struct __pyx_vtabstruct_7pyarrow_7_flight_ServerAuthHandler *)((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_auth_handler)->__pyx_vtab)->to_handler(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v_auth_handler)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2980, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":2979
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
 *                                 f"not a '{type(auth_handler)}'")
 *             c_options.get().auth_handler.reset(             # <<<<<<<<<<<<<<
 *                 (<ServerAuthHandler> auth_handler).to_handler())
 * 
*/
    __pyx_v_c_options.get()->auth_handler.reset(__pyx_t_11);

    /* "pyarrow/_flight.pyx":2975
 *         c_options.get().root_certificates = root_certificates
 * 
 *         if auth_handler:             # <<<<<<<<<<<<<<
 *             if not isinstance(auth_handler, ServerAuthHandler):
 *                 raise TypeError("auth_handler must be a ServerAuthHandler, "
*/
  }

  /* "pyarrow/_flight.pyx":2982
 *                 (<ServerAuthHandler> auth_handler).to_handler())
 * 
 *         if tls_certificates:             # <<<<<<<<<<<<<<
 *             for cert, key in tls_certificates:
 *                 c_cert.pem_cert = tobytes(cert)
*/
  if (__pyx_v_tls_certificates == Py_None) __pyx_t_4 = 0;
  else
  {
    Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_tls_certificates);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 2982, __pyx_L1_error)
    __pyx_t_4 = (__pyx_temp != 0);
  }

  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":2983
 * 
 *         if tls_certificates:
 *             for cert, key in tls_certificates:             # <<<<<<<<<<<<<<
 *                 c_cert.pem_cert = tobytes(cert)
 *                 c_cert.pem_key = tobytes(key)
*/
    if (unlikely(__pyx_v_tls_certificates == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 2983, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_v_tls_certificates; __Pyx_INCREF(__pyx_t_5);
    __pyx_t_12 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2983, __pyx_L1_error)
        #endif
        if (__pyx_t_12 >= __pyx_temp) break;
      }
      __pyx_t_9 = __Pyx_PyList_GetItemRefFast(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference);
      ++__pyx_t_12;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
        PyObject* sequence = __pyx_t_9;
        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, 2983, __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_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2983, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2983, __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, 2983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2983, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13);
        index = 0; __pyx_t_6 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < (0)) __PYX_ERR(0, 2983, __pyx_L1_error)
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2983, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_cert, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pyarrow/_flight.pyx":2984
 *         if tls_certificates:
 *             for cert, key in tls_certificates:
 *                 c_cert.pem_cert = tobytes(cert)             # <<<<<<<<<<<<<<
 *                 c_cert.pem_key = tobytes(key)
 *                 c_options.get().tls_certificates.push_back(c_cert)
*/
      __pyx_t_7 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_7);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_cert};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2984, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2984, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_c_cert.pem_cert = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

      /* "pyarrow/_flight.pyx":2985
 *             for cert, key in tls_certificates:
 *                 c_cert.pem_cert = tobytes(cert)
 *                 c_cert.pem_key = tobytes(key)             # <<<<<<<<<<<<<<
 *                 c_options.get().tls_certificates.push_back(c_cert)
 * 
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_key};
        __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2985, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
      }
      __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2985, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_v_c_cert.pem_key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

      /* "pyarrow/_flight.pyx":2986
 *                 c_cert.pem_cert = tobytes(cert)
 *                 c_cert.pem_key = tobytes(key)
 *                 c_options.get().tls_certificates.push_back(c_cert)             # <<<<<<<<<<<<<<
 * 
 *         if middleware:
*/
      try {
        __pyx_v_c_options.get()->tls_certificates.push_back(__pyx_v_c_cert);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2986, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":2983
 * 
 *         if tls_certificates:
 *             for cert, key in tls_certificates:             # <<<<<<<<<<<<<<
 *                 c_cert.pem_cert = tobytes(cert)
 *                 c_cert.pem_key = tobytes(key)
*/
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2982
 *                 (<ServerAuthHandler> auth_handler).to_handler())
 * 
 *         if tls_certificates:             # <<<<<<<<<<<<<<
 *             for cert, key in tls_certificates:
 *                 c_cert.pem_cert = tobytes(cert)
*/
  }

  /* "pyarrow/_flight.pyx":2988
 *                 c_options.get().tls_certificates.push_back(c_cert)
 * 
 *         if middleware:             # <<<<<<<<<<<<<<
 *             non_tracing_middleware = {}
 *             enable_tracing = None
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_middleware); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2988, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/_flight.pyx":2989
 * 
 *         if middleware:
 *             non_tracing_middleware = {}             # <<<<<<<<<<<<<<
 *             enable_tracing = None
 *             for key, factory in middleware.items():
*/
    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_non_tracing_middleware = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":2990
 *         if middleware:
 *             non_tracing_middleware = {}
 *             enable_tracing = None             # <<<<<<<<<<<<<<
 *             for key, factory in middleware.items():
 *                 if isinstance(factory, TracingServerMiddlewareFactory):
*/
    __Pyx_INCREF(Py_None);
    __pyx_v_enable_tracing = Py_None;

    /* "pyarrow/_flight.pyx":2991
 *             non_tracing_middleware = {}
 *             enable_tracing = None
 *             for key, factory in middleware.items():             # <<<<<<<<<<<<<<
 *                 if isinstance(factory, TracingServerMiddlewareFactory):
 *                     if enable_tracing is not None:
*/
    __pyx_t_12 = 0;
    if (unlikely(__pyx_v_middleware == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(0, 2991, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_middleware, 1, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_15), (&__pyx_t_16)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_9;
    __pyx_t_9 = 0;
    while (1) {
      __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_15, &__pyx_t_12, &__pyx_t_9, &__pyx_t_7, NULL, __pyx_t_16);
      if (unlikely(__pyx_t_17 == 0)) break;
      if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 2991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_factory, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pyarrow/_flight.pyx":2992
 *             enable_tracing = None
 *             for key, factory in middleware.items():
 *                 if isinstance(factory, TracingServerMiddlewareFactory):             # <<<<<<<<<<<<<<
 *                     if enable_tracing is not None:
 *                         raise ValueError(
*/
      __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_factory, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory); 
      if (__pyx_t_4) {

        /* "pyarrow/_flight.pyx":2993
 *             for key, factory in middleware.items():
 *                 if isinstance(factory, TracingServerMiddlewareFactory):
 *                     if enable_tracing is not None:             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             "Can only provide "
*/
        __pyx_t_4 = (__pyx_v_enable_tracing != Py_None);
        if (unlikely(__pyx_t_4)) {

          /* "pyarrow/_flight.pyx":2994
 *                 if isinstance(factory, TracingServerMiddlewareFactory):
 *                     if enable_tracing is not None:
 *                         raise ValueError(             # <<<<<<<<<<<<<<
 *                             "Can only provide "
 *                             "TracingServerMiddlewareFactory once")
*/
          __pyx_t_9 = NULL;
          __pyx_t_10 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Can_only_provide_TracingServerMi};
            __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2994, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(0, 2994, __pyx_L1_error)

          /* "pyarrow/_flight.pyx":2993
 *             for key, factory in middleware.items():
 *                 if isinstance(factory, TracingServerMiddlewareFactory):
 *                     if enable_tracing is not None:             # <<<<<<<<<<<<<<
 *                         raise ValueError(
 *                             "Can only provide "
*/
        }

        /* "pyarrow/_flight.pyx":2997
 *                             "Can only provide "
 *                             "TracingServerMiddlewareFactory once")
 *                     if tobytes(key) == CPyServerMiddlewareName:             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Middleware key cannot be {key}")
 *                     enable_tracing = key
*/
        __pyx_t_9 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_10 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_10 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_key};
          __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2997, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
        }
        __pyx_t_6 = __Pyx_PyBytes_FromString( arrow::py::flight::kPyServerMiddlewareName); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2997, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_t_7, __pyx_t_6, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2997, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__pyx_t_4)) {

          /* "pyarrow/_flight.pyx":2998
 *                             "TracingServerMiddlewareFactory once")
 *                     if tobytes(key) == CPyServerMiddlewareName:
 *                         raise ValueError(f"Middleware key cannot be {key}")             # <<<<<<<<<<<<<<
 *                     enable_tracing = key
 *                 else:
*/
          __pyx_t_7 = NULL;
          __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_key, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2998, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Middleware_key_cannot_be, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2998, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_10 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_13};
            __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2998, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_6);
          }
          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __PYX_ERR(0, 2998, __pyx_L1_error)

          /* "pyarrow/_flight.pyx":2997
 *                             "Can only provide "
 *                             "TracingServerMiddlewareFactory once")
 *                     if tobytes(key) == CPyServerMiddlewareName:             # <<<<<<<<<<<<<<
 *                         raise ValueError(f"Middleware key cannot be {key}")
 *                     enable_tracing = key
*/
        }

        /* "pyarrow/_flight.pyx":2999
 *                     if tobytes(key) == CPyServerMiddlewareName:
 *                         raise ValueError(f"Middleware key cannot be {key}")
 *                     enable_tracing = key             # <<<<<<<<<<<<<<
 *                 else:
 *                     non_tracing_middleware[key] = factory
*/
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_DECREF_SET(__pyx_v_enable_tracing, __pyx_v_key);

        /* "pyarrow/_flight.pyx":2992
 *             enable_tracing = None
 *             for key, factory in middleware.items():
 *                 if isinstance(factory, TracingServerMiddlewareFactory):             # <<<<<<<<<<<<<<
 *                     if enable_tracing is not None:
 *                         raise ValueError(
*/
        goto __pyx_L14;
      }

      /* "pyarrow/_flight.pyx":3001
 *                     enable_tracing = key
 *                 else:
 *                     non_tracing_middleware[key] = factory             # <<<<<<<<<<<<<<
 * 
 *             if enable_tracing:
*/
      /*else*/ {
        if (unlikely((PyDict_SetItem(__pyx_v_non_tracing_middleware, __pyx_v_key, __pyx_v_factory) < 0))) __PYX_ERR(0, 3001, __pyx_L1_error)
      }
      __pyx_L14:;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":3003
 *                     non_tracing_middleware[key] = factory
 * 
 *             if enable_tracing:             # <<<<<<<<<<<<<<
 *                 c_middleware.first = tobytes(enable_tracing)
 *                 c_middleware.second = MakeTracingServerMiddlewareFactory()
*/
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_enable_tracing); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3003, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "pyarrow/_flight.pyx":3004
 * 
 *             if enable_tracing:
 *                 c_middleware.first = tobytes(enable_tracing)             # <<<<<<<<<<<<<<
 *                 c_middleware.second = MakeTracingServerMiddlewareFactory()
 *                 c_options.get().middleware.push_back(c_middleware)
*/
      __pyx_t_6 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tobytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 3004, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_10 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
        assert(__pyx_t_6);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
        __pyx_t_10 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_enable_tracing};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3004, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3004, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_c_middleware.first = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

      /* "pyarrow/_flight.pyx":3005
 *             if enable_tracing:
 *                 c_middleware.first = tobytes(enable_tracing)
 *                 c_middleware.second = MakeTracingServerMiddlewareFactory()             # <<<<<<<<<<<<<<
 *                 c_options.get().middleware.push_back(c_middleware)
 * 
*/
      __pyx_v_c_middleware.second =  arrow::flight::MakeTracingServerMiddlewareFactory();

      /* "pyarrow/_flight.pyx":3006
 *                 c_middleware.first = tobytes(enable_tracing)
 *                 c_middleware.second = MakeTracingServerMiddlewareFactory()
 *                 c_options.get().middleware.push_back(c_middleware)             # <<<<<<<<<<<<<<
 * 
 *             py_middleware = _ServerMiddlewareFactoryWrapper(
*/
      try {
        __pyx_v_c_options.get()->middleware.push_back(__pyx_v_c_middleware);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 3006, __pyx_L1_error)
      }

      /* "pyarrow/_flight.pyx":3003
 *                     non_tracing_middleware[key] = factory
 * 
 *             if enable_tracing:             # <<<<<<<<<<<<<<
 *                 c_middleware.first = tobytes(enable_tracing)
 *                 c_middleware.second = MakeTracingServerMiddlewareFactory()
*/
    }

    /* "pyarrow/_flight.pyx":3008
 *                 c_options.get().middleware.push_back(c_middleware)
 * 
 *             py_middleware = _ServerMiddlewareFactoryWrapper(             # <<<<<<<<<<<<<<
 *                 non_tracing_middleware)
 *             c_middleware.first = CPyServerMiddlewareName
*/
    __pyx_t_13 = NULL;

    /* "pyarrow/_flight.pyx":3009
 * 
 *             py_middleware = _ServerMiddlewareFactoryWrapper(
 *                 non_tracing_middleware)             # <<<<<<<<<<<<<<
 *             c_middleware.first = CPyServerMiddlewareName
 *             c_middleware.second.reset(new CPyServerMiddlewareFactory(
*/
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_non_tracing_middleware};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3008, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_5);
    }
    __pyx_v_py_middleware = ((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/_flight.pyx":3010
 *             py_middleware = _ServerMiddlewareFactoryWrapper(
 *                 non_tracing_middleware)
 *             c_middleware.first = CPyServerMiddlewareName             # <<<<<<<<<<<<<<
 *             c_middleware.second.reset(new CPyServerMiddlewareFactory(
 *                 py_middleware,
*/
    __pyx_v_c_middleware.first =  arrow::py::flight::kPyServerMiddlewareName;

    /* "pyarrow/_flight.pyx":3011
 *                 non_tracing_middleware)
 *             c_middleware.first = CPyServerMiddlewareName
 *             c_middleware.second.reset(new CPyServerMiddlewareFactory(             # <<<<<<<<<<<<<<
 *                 py_middleware,
 *                 start_call))
*/
    __pyx_v_c_middleware.second.reset(new  arrow::py::flight::PyServerMiddlewareFactory(((PyObject *)__pyx_v_py_middleware), __pyx_v_start_call));

    /* "pyarrow/_flight.pyx":3014
 *                 py_middleware,
 *                 start_call))
 *             c_options.get().middleware.push_back(c_middleware)             # <<<<<<<<<<<<<<
 * 
 *         vtable.list_flights = &_list_flights
*/
    try {
      __pyx_v_c_options.get()->middleware.push_back(__pyx_v_c_middleware);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3014, __pyx_L1_error)
    }

    /* "pyarrow/_flight.pyx":2988
 *                 c_options.get().tls_certificates.push_back(c_cert)
 * 
 *         if middleware:             # <<<<<<<<<<<<<<
 *             non_tracing_middleware = {}
 *             enable_tracing = None
*/
  }

  /* "pyarrow/_flight.pyx":3016
 *             c_options.get().middleware.push_back(c_middleware)
 * 
 *         vtable.list_flights = &_list_flights             # <<<<<<<<<<<<<<
 *         vtable.get_flight_info = &_get_flight_info
 *         vtable.get_schema = &_get_schema
*/
  __pyx_v_vtable.list_flights = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_list_flights> )(&__pyx_f_7pyarrow_7_flight__list_flights));

  /* "pyarrow/_flight.pyx":3017
 * 
 *         vtable.list_flights = &_list_flights
 *         vtable.get_flight_info = &_get_flight_info             # <<<<<<<<<<<<<<
 *         vtable.get_schema = &_get_schema
 *         vtable.do_put = &_do_put
*/
  __pyx_v_vtable.get_flight_info = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_flight_info> )(&__pyx_f_7pyarrow_7_flight__get_flight_info));

  /* "pyarrow/_flight.pyx":3018
 *         vtable.list_flights = &_list_flights
 *         vtable.get_flight_info = &_get_flight_info
 *         vtable.get_schema = &_get_schema             # <<<<<<<<<<<<<<
 *         vtable.do_put = &_do_put
 *         vtable.do_get = &_do_get
*/
  __pyx_v_vtable.get_schema = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_get_schema> )(&__pyx_f_7pyarrow_7_flight__get_schema));

  /* "pyarrow/_flight.pyx":3019
 *         vtable.get_flight_info = &_get_flight_info
 *         vtable.get_schema = &_get_schema
 *         vtable.do_put = &_do_put             # <<<<<<<<<<<<<<
 *         vtable.do_get = &_do_get
 *         vtable.do_exchange = &_do_exchange
*/
  __pyx_v_vtable.do_put = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_put> )(&__pyx_f_7pyarrow_7_flight__do_put));

  /* "pyarrow/_flight.pyx":3020
 *         vtable.get_schema = &_get_schema
 *         vtable.do_put = &_do_put
 *         vtable.do_get = &_do_get             # <<<<<<<<<<<<<<
 *         vtable.do_exchange = &_do_exchange
 *         vtable.list_actions = &_list_actions
*/
  __pyx_v_vtable.do_get = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_get> )(&__pyx_f_7pyarrow_7_flight__do_get));

  /* "pyarrow/_flight.pyx":3021
 *         vtable.do_put = &_do_put
 *         vtable.do_get = &_do_get
 *         vtable.do_exchange = &_do_exchange             # <<<<<<<<<<<<<<
 *         vtable.list_actions = &_list_actions
 *         vtable.do_action = &_do_action
*/
  __pyx_v_vtable.do_exchange = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_exchange> )(&__pyx_f_7pyarrow_7_flight__do_exchange));

  /* "pyarrow/_flight.pyx":3022
 *         vtable.do_get = &_do_get
 *         vtable.do_exchange = &_do_exchange
 *         vtable.list_actions = &_list_actions             # <<<<<<<<<<<<<<
 *         vtable.do_action = &_do_action
 * 
*/
  __pyx_v_vtable.list_actions = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_list_actions> )(&__pyx_f_7pyarrow_7_flight__list_actions));

  /* "pyarrow/_flight.pyx":3023
 *         vtable.do_exchange = &_do_exchange
 *         vtable.list_actions = &_list_actions
 *         vtable.do_action = &_do_action             # <<<<<<<<<<<<<<
 * 
 *         c_server = new PyFlightServer(self, vtable)
*/
  __pyx_v_vtable.do_action = ((std::function<__pyx_t_7pyarrow_8includes_15libarrow_flight_cb_do_action> )(&__pyx_f_7pyarrow_7_flight__do_action));

  /* "pyarrow/_flight.pyx":3025
 *         vtable.do_action = &_do_action
 * 
 *         c_server = new PyFlightServer(self, vtable)             # <<<<<<<<<<<<<<
 *         self.server.reset(c_server)
 *         with nogil:
*/
  __pyx_v_c_server = new arrow::py::flight::PyFlightServer(((PyObject *)__pyx_v_self), __pyx_v_vtable);

  /* "pyarrow/_flight.pyx":3026
 * 
 *         c_server = new PyFlightServer(self, vtable)
 *         self.server.reset(c_server)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(c_server.Init(deref(c_options)))
*/
  __pyx_v_self->server.reset(__pyx_v_c_server);

  /* "pyarrow/_flight.pyx":3027
 *         c_server = new PyFlightServer(self, vtable)
 *         self.server.reset(c_server)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(c_server.Init(deref(c_options)))
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":3028
 *         self.server.reset(c_server)
 *         with nogil:
 *             check_flight_status(c_server.Init(deref(c_options)))             # <<<<<<<<<<<<<<
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()
 *         finalizer.server = self.server
*/
        __pyx_t_16 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_c_server->Init((*__pyx_v_c_options))); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 3028, __pyx_L19_error)
      }

      /* "pyarrow/_flight.pyx":3027
 *         c_server = new PyFlightServer(self, vtable)
 *         self.server.reset(c_server)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(c_server.Init(deref(c_options)))
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L20;
        }
        __pyx_L19_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L20:;
      }
  }

  /* "pyarrow/_flight.pyx":3029
 *         with nogil:
 *             check_flight_status(c_server.Init(deref(c_options)))
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()             # <<<<<<<<<<<<<<
 *         finalizer.server = self.server
 *         self.finalizer = weakref.finalize(self, finalizer.finalize)
*/
  __pyx_t_13 = NULL;
  __pyx_t_10 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3029, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_finalizer = ((struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pyarrow/_flight.pyx":3030
 *             check_flight_status(c_server.Init(deref(c_options)))
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()
 *         finalizer.server = self.server             # <<<<<<<<<<<<<<
 *         self.finalizer = weakref.finalize(self, finalizer.finalize)
 * 
*/
  __pyx_t_18 = __pyx_v_self->server;
  __pyx_v_finalizer->server = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_18);

  /* "pyarrow/_flight.pyx":3031
 *         cdef _FlightServerFinalizer finalizer = _FlightServerFinalizer()
 *         finalizer.server = self.server
 *         self.finalizer = weakref.finalize(self, finalizer.finalize)             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __pyx_t_13 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_weakref); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_finalize); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_finalizer), __pyx_mstate_global->__pyx_n_u_finalize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
    assert(__pyx_t_13);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
    __Pyx_INCREF(__pyx_t_13);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_13, ((PyObject *)__pyx_v_self), __pyx_t_6};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->finalizer);
  __Pyx_DECREF(__pyx_v_self->finalizer);
  __pyx_v_self->finalizer = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pyarrow/_flight.pyx":2958
 *                   tobytes(root_certificates or b""), middleware)
 * 
 *     cdef init(self, Location location, ServerAuthHandler auth_handler,             # <<<<<<<<<<<<<<
 *               list tls_certificates, c_bool verify_client,
 *               bytes root_certificates, dict middleware):
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cert);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_non_tracing_middleware);
  __Pyx_XDECREF(__pyx_v_enable_tracing);
  __Pyx_XDECREF(__pyx_v_factory);
  __Pyx_XDECREF((PyObject *)__pyx_v_py_middleware);
  __Pyx_XDECREF((PyObject *)__pyx_v_finalizer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3033
 *         self.finalizer = weakref.finalize(self, finalizer.finalize)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self):
 *         """
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_4port_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_4port_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_7pyarrow_7_flight_16FlightServerBase_4port___get__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_4port___get__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__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);

  /* "pyarrow/_flight.pyx":3042
 *         socket).
 *         """
 *         return self.server.get().port()             # <<<<<<<<<<<<<<
 * 
 *     def list_flights(self, context, criteria):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->server.get()->port()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":3033
 *         self.finalizer = weakref.finalize(self, finalizer.finalize)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def port(self):
 *         """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.port.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3044
 *         return self.server.get().port()
 * 
 *     def list_flights(self, context, criteria):             # <<<<<<<<<<<<<<
 *         """List flights available on this service.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_3list_flights(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_2list_flights, "FlightServerBase.list_flights(self, context, criteria)\n\nList flights available on this service.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\ncriteria : bytes\n    Filter criteria provided by the client.\n\nReturns\n-------\niterator of FlightInfo");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_3list_flights = {"list_flights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_3list_flights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_2list_flights};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_3list_flights(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_criteria = 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("list_flights (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_context,&__pyx_mstate_global->__pyx_n_u_criteria,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, 3044, __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, 3044, __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, 3044, __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, "list_flights", 0) < (0)) __PYX_ERR(0, 3044, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("list_flights", 1, 2, 2, i); __PYX_ERR(0, 3044, __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, 3044, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3044, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_criteria = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_flights", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3044, __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("pyarrow._flight.FlightServerBase.list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_2list_flights(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_criteria);

  /* 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_7pyarrow_7_flight_16FlightServerBase_2list_flights(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_criteria) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_flights", 0);

  /* "pyarrow/_flight.pyx":3062
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def get_flight_info(self, context, descriptor):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3062, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3044
 *         return self.server.get().port()
 * 
 *     def list_flights(self, context, criteria):             # <<<<<<<<<<<<<<
 *         """List flights available on this service.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.list_flights", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3064
 *         raise NotImplementedError
 * 
 *     def get_flight_info(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get information about a flight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_5get_flight_info(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_4get_flight_info, "FlightServerBase.get_flight_info(self, context, descriptor)\n\nGet information about a flight.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\ndescriptor : FlightDescriptor\n    The descriptor for the flight provided by the client.\n\nReturns\n-------\nFlightInfo");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_5get_flight_info = {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_5get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_4get_flight_info};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_5get_flight_info(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_descriptor = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_flight_info (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_context,&__pyx_mstate_global->__pyx_n_u_descriptor,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, 3064, __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, 3064, __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, 3064, __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_flight_info", 0) < (0)) __PYX_ERR(0, 3064, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_flight_info", 1, 2, 2, i); __PYX_ERR(0, 3064, __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, 3064, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3064, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_descriptor = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_flight_info", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3064, __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("pyarrow._flight.FlightServerBase.get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_4get_flight_info(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_descriptor);

  /* 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_7pyarrow_7_flight_16FlightServerBase_4get_flight_info(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_flight_info", 0);

  /* "pyarrow/_flight.pyx":3082
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def get_schema(self, context, descriptor):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3082, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3064
 *         raise NotImplementedError
 * 
 *     def get_flight_info(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get information about a flight.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.get_flight_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3084
 *         raise NotImplementedError
 * 
 *     def get_schema(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get the schema of a flight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_7get_schema(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_6get_schema, "FlightServerBase.get_schema(self, context, descriptor)\n\nGet the schema of a flight.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\ndescriptor : FlightDescriptor\n    The descriptor for the flight provided by the client.\n\nReturns\n-------\nSchema");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_7get_schema = {"get_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_7get_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_6get_schema};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_7get_schema(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_descriptor = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_schema (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_context,&__pyx_mstate_global->__pyx_n_u_descriptor,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, 3084, __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, 3084, __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, 3084, __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_schema", 0) < (0)) __PYX_ERR(0, 3084, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_schema", 1, 2, 2, i); __PYX_ERR(0, 3084, __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, 3084, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3084, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_descriptor = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_schema", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3084, __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("pyarrow._flight.FlightServerBase.get_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_6get_schema(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_descriptor);

  /* 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_7pyarrow_7_flight_16FlightServerBase_6get_schema(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_schema", 0);

  /* "pyarrow/_flight.pyx":3102
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def do_put(self, context, descriptor, reader: MetadataRecordBatchReader,
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3102, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3084
 *         raise NotImplementedError
 * 
 *     def get_schema(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get the schema of a flight.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.get_schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3104
 *         raise NotImplementedError
 * 
 *     def do_put(self, context, descriptor, reader: MetadataRecordBatchReader,             # <<<<<<<<<<<<<<
 *                writer: FlightMetadataWriter):
 *         """Write data to a flight.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_9do_put(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_8do_put, "FlightServerBase.do_put(self, context, descriptor, MetadataRecordBatchReader reader: MetadataRecordBatchReader, FlightMetadataWriter writer: FlightMetadataWriter)\n\nWrite data to a flight.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\ndescriptor : FlightDescriptor\n    The descriptor for the flight provided by the client.\nreader : MetadataRecordBatchReader\n    A reader for data uploaded by the client.\nwriter : FlightMetadataWriter\n    A writer to send responses to the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_9do_put = {"do_put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_9do_put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_8do_put};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_9do_put(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_descriptor = 0;
  CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_reader = 0;
  CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_writer = 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("do_put (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_context,&__pyx_mstate_global->__pyx_n_u_descriptor,&__pyx_mstate_global->__pyx_n_u_reader,&__pyx_mstate_global->__pyx_n_u_writer,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, 3104, __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, 3104, __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, 3104, __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, 3104, __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, 3104, __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, "do_put", 0) < (0)) __PYX_ERR(0, 3104, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_put", 1, 4, 4, i); __PYX_ERR(0, 3104, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      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, 3104, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3104, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3104, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3104, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_descriptor = values[1];
    __pyx_v_reader = ((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)values[2]);
    __pyx_v_writer = ((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)values[3]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_put", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 3104, __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("pyarrow._flight.FlightServerBase.do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reader), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader, 0, "reader", 0))) __PYX_ERR(0, 3104, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter, 0, "writer", 0))) __PYX_ERR(0, 3105, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_8do_put(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_descriptor, __pyx_v_reader, __pyx_v_writer);

  /* 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_7pyarrow_7_flight_16FlightServerBase_8do_put(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor, CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *__pyx_v_reader, CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *__pyx_v_writer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_put", 0);

  /* "pyarrow/_flight.pyx":3123
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def do_get(self, context, ticket):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3123, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3104
 *         raise NotImplementedError
 * 
 *     def do_put(self, context, descriptor, reader: MetadataRecordBatchReader,             # <<<<<<<<<<<<<<
 *                writer: FlightMetadataWriter):
 *         """Write data to a flight.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.do_put", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3125
 *         raise NotImplementedError
 * 
 *     def do_get(self, context, ticket):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_11do_get(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_10do_get, "FlightServerBase.do_get(self, context, ticket)\n\nWrite data to a flight.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\nticket : Ticket\n    The ticket for the flight.\n\nReturns\n-------\nFlightDataStream\n    A stream of data to send back to the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_11do_get = {"do_get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_11do_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_10do_get};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_11do_get(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_ticket = 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("do_get (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_context,&__pyx_mstate_global->__pyx_n_u_ticket,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, 3125, __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, 3125, __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, 3125, __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, "do_get", 0) < (0)) __PYX_ERR(0, 3125, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_get", 1, 2, 2, i); __PYX_ERR(0, 3125, __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, 3125, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3125, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_ticket = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_get", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3125, __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("pyarrow._flight.FlightServerBase.do_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_10do_get(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_ticket);

  /* 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_7pyarrow_7_flight_16FlightServerBase_10do_get(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_ticket) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_get", 0);

  /* "pyarrow/_flight.pyx":3144
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def do_exchange(self, context, descriptor, reader, writer):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3144, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3125
 *         raise NotImplementedError
 * 
 *     def do_get(self, context, ticket):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.do_get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3146
 *         raise NotImplementedError
 * 
 *     def do_exchange(self, context, descriptor, reader, writer):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_13do_exchange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_12do_exchange, "FlightServerBase.do_exchange(self, context, descriptor, reader, writer)\n\nWrite data to a flight.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\ndescriptor : FlightDescriptor\n    The descriptor for the flight provided by the client.\nreader : MetadataRecordBatchReader\n    A reader for data uploaded by the client.\nwriter : MetadataRecordBatchWriter\n    A writer to send responses to the client.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_13do_exchange = {"do_exchange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_13do_exchange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_12do_exchange};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_13do_exchange(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_descriptor = 0;
  CYTHON_UNUSED PyObject *__pyx_v_reader = 0;
  CYTHON_UNUSED PyObject *__pyx_v_writer = 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("do_exchange (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_context,&__pyx_mstate_global->__pyx_n_u_descriptor,&__pyx_mstate_global->__pyx_n_u_reader,&__pyx_mstate_global->__pyx_n_u_writer,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, 3146, __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, 3146, __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, 3146, __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, 3146, __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, 3146, __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, "do_exchange", 0) < (0)) __PYX_ERR(0, 3146, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_exchange", 1, 4, 4, i); __PYX_ERR(0, 3146, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      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, 3146, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3146, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3146, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3146, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_descriptor = values[1];
    __pyx_v_reader = values[2];
    __pyx_v_writer = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_exchange", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 3146, __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("pyarrow._flight.FlightServerBase.do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_12do_exchange(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_descriptor, __pyx_v_reader, __pyx_v_writer);

  /* 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_7pyarrow_7_flight_16FlightServerBase_12do_exchange(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_descriptor, CYTHON_UNUSED PyObject *__pyx_v_reader, CYTHON_UNUSED PyObject *__pyx_v_writer) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_exchange", 0);

  /* "pyarrow/_flight.pyx":3164
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def list_actions(self, context):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3164, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3146
 *         raise NotImplementedError
 * 
 *     def do_exchange(self, context, descriptor, reader, writer):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.do_exchange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3166
 *         raise NotImplementedError
 * 
 *     def list_actions(self, context):             # <<<<<<<<<<<<<<
 *         """List custom actions available on this server.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_15list_actions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_14list_actions, "FlightServerBase.list_actions(self, context)\n\nList custom actions available on this server.\n\nApplications should override this method to implement their\nown behavior. The default method raises a NotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\n\nReturns\n-------\niterator of ActionType or tuple");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_15list_actions = {"list_actions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_15list_actions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_14list_actions};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_15list_actions(PyObject *__pyx_v_self, 
#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_context = 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("list_actions (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_context,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, 3166, __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, 3166, __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, "list_actions", 0) < (0)) __PYX_ERR(0, 3166, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("list_actions", 1, 1, 1, i); __PYX_ERR(0, 3166, __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, 3166, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("list_actions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3166, __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("pyarrow._flight.FlightServerBase.list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_14list_actions(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context);

  /* 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_7pyarrow_7_flight_16FlightServerBase_14list_actions(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_actions", 0);

  /* "pyarrow/_flight.pyx":3182
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def do_action(self, context, action):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3182, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3166
 *         raise NotImplementedError
 * 
 *     def list_actions(self, context):             # <<<<<<<<<<<<<<
 *         """List custom actions available on this server.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.list_actions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3184
 *         raise NotImplementedError
 * 
 *     def do_action(self, context, action):             # <<<<<<<<<<<<<<
 *         """Execute a custom action.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_17do_action(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_16do_action, "FlightServerBase.do_action(self, context, action)\n\nExecute a custom action.\n\nThis method should return an iterator, or it should be a\ngenerator. Applications should override this method to\nimplement their own behavior. The default method raises a\nNotImplementedError.\n\nParameters\n----------\ncontext : ServerCallContext\n    Common contextual information.\naction : Action\n    The action to execute.\n\nReturns\n-------\niterator of bytes");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_17do_action = {"do_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_17do_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_16do_action};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_17do_action(PyObject *__pyx_v_self, 
#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_context = 0;
  CYTHON_UNUSED PyObject *__pyx_v_action = 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("do_action (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_context,&__pyx_mstate_global->__pyx_n_u_action,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, 3184, __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, 3184, __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, 3184, __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, "do_action", 0) < (0)) __PYX_ERR(0, 3184, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("do_action", 1, 2, 2, i); __PYX_ERR(0, 3184, __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, 3184, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3184, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
    __pyx_v_action = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("do_action", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3184, __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("pyarrow._flight.FlightServerBase.do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_16do_action(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_context, __pyx_v_action);

  /* 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_7pyarrow_7_flight_16FlightServerBase_16do_action(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, CYTHON_UNUSED PyObject *__pyx_v_action) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("do_action", 0);

  /* "pyarrow/_flight.pyx":3204
 * 
 *         """
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def serve(self):
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(0, 3204, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":3184
 *         raise NotImplementedError
 * 
 *     def do_action(self, context, action):             # <<<<<<<<<<<<<<
 *         """Execute a custom action.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.do_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3206
 *         raise NotImplementedError
 * 
 *     def serve(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_19serve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_18serve, "FlightServerBase.serve(self)\n\nBlock until the server shuts down.\n\nThis method only returns if shutdown() is called or a signal is\nreceived.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_19serve = {"serve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_19serve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_18serve};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_19serve(PyObject *__pyx_v_self, 
#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("serve (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("serve", 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("serve", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_18serve(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_18serve(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  arrow::Status __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("serve", 0);

  /* "pyarrow/_flight.pyx":3212
 *         received.
 *         """
 *         if self.server.get() == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("run() on uninitialized FlightServerBase")
 *         with nogil:
*/
  __pyx_t_1 = (__pyx_v_self->server.get() == nullptr);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":3213
 *         """
 *         if self.server.get() == nullptr:
 *             raise ValueError("run() on uninitialized FlightServerBase")             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(self.server.get().ServeWithSignals())
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_run_on_uninitialized_FlightServe};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3213, __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, 3213, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":3212
 *         received.
 *         """
 *         if self.server.get() == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("run() on uninitialized FlightServerBase")
 *         with nogil:
*/
  }

  /* "pyarrow/_flight.pyx":3214
 *         if self.server.get() == nullptr:
 *             raise ValueError("run() on uninitialized FlightServerBase")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.server.get().ServeWithSignals())
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":3215
 *             raise ValueError("run() on uninitialized FlightServerBase")
 *         with nogil:
 *             check_flight_status(self.server.get().ServeWithSignals())             # <<<<<<<<<<<<<<
 * 
 *     def run(self):
*/
        __pyx_t_5 = __pyx_v_self->server.get()->ServeWithSignals(); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 3215, __pyx_L5_error)
        __pyx_t_6 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 3215, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":3214
 *         if self.server.get() == nullptr:
 *             raise ValueError("run() on uninitialized FlightServerBase")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.server.get().ServeWithSignals())
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":3206
 *         raise NotImplementedError
 * 
 *     def serve(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.serve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3217
 *             check_flight_status(self.server.get().ServeWithSignals())
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_21run(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_20run, "FlightServerBase.run(self)\n\nBlock until the server shuts down.\n\n.. deprecated:: 0.15.0\n    Use the ``FlightServer.serve`` method instead");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_21run = {"run", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_21run, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_20run};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_21run(PyObject *__pyx_v_self, 
#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("run (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("run", 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("run", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_20run(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

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

  /* "pyarrow/_flight.pyx":3223
 *             Use the ``FlightServer.serve`` method instead
 *         """
 *         warnings.warn("The 'FlightServer.run' method is deprecated, use "             # <<<<<<<<<<<<<<
 *                       "FlightServer.serve method instead")
 *         self.serve()
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3223, __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_mstate_global->__pyx_kp_u_The_FlightServer_run_method_is_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__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, 3223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":3225
 *         warnings.warn("The 'FlightServer.run' method is deprecated, use "
 *                       "FlightServer.serve method instead")
 *         self.serve()             # <<<<<<<<<<<<<<
 * 
 *     def shutdown(self):
*/
  __pyx_t_4 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_serve, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/_flight.pyx":3217
 *             check_flight_status(self.server.get().ServeWithSignals())
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3227
 *         self.serve()
 * 
 *     def shutdown(self):             # <<<<<<<<<<<<<<
 *         """Shut down the server, blocking until current requests finish.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_23shutdown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_22shutdown, "FlightServerBase.shutdown(self)\n\nShut down the server, blocking until current requests finish.\n\nDo not call this directly from the implementation of a Flight\nmethod, as then the server will block forever waiting for that\nrequest to finish. Instead, call this method from a background\nthread.\n\nThis method should only be called once.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_23shutdown = {"shutdown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_23shutdown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_22shutdown};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_23shutdown(PyObject *__pyx_v_self, 
#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("shutdown (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("shutdown", 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("shutdown", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_22shutdown(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

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

  /* "pyarrow/_flight.pyx":3241
 *         # methods will never get to run, so this will hang
 *         # indefinitely.
 *         if self.server.get() == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")
 *         with nogil:
*/
  __pyx_t_1 = (__pyx_v_self->server.get() == nullptr);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/_flight.pyx":3242
 *         # indefinitely.
 *         if self.server.get() == nullptr:
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_flight_status(self.server.get().Shutdown())
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_shutdown_on_uninitialized_Flight};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3242, __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, 3242, __pyx_L1_error)

    /* "pyarrow/_flight.pyx":3241
 *         # methods will never get to run, so this will hang
 *         # indefinitely.
 *         if self.server.get() == nullptr:             # <<<<<<<<<<<<<<
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")
 *         with nogil:
*/
  }

  /* "pyarrow/_flight.pyx":3243
 *         if self.server.get() == nullptr:
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.server.get().Shutdown())
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":3244
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")
 *         with nogil:
 *             check_flight_status(self.server.get().Shutdown())             # <<<<<<<<<<<<<<
 * 
 *     def wait(self):
*/
        __pyx_t_5 = __pyx_f_7pyarrow_7_flight_check_flight_status(__pyx_v_self->server.get()->Shutdown()); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 3244, __pyx_L5_error)
      }

      /* "pyarrow/_flight.pyx":3243
 *         if self.server.get() == nullptr:
 *             raise ValueError("shutdown() on uninitialized FlightServerBase")
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_flight_status(self.server.get().Shutdown())
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/_flight.pyx":3227
 *         self.serve()
 * 
 *     def shutdown(self):             # <<<<<<<<<<<<<<
 *         """Shut down the server, blocking until current requests finish.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3246
 *             check_flight_status(self.server.get().Shutdown())
 * 
 *     def wait(self):             # <<<<<<<<<<<<<<
 *         """Block until server is terminated with shutdown."""
 *         with nogil:
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_25wait(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_24wait, "FlightServerBase.wait(self)\n\nBlock until server is terminated with shutdown.");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_25wait = {"wait", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_25wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_24wait};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_25wait(PyObject *__pyx_v_self, 
#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("wait (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("wait", 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("wait", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_24wait(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_24wait(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait", 0);

  /* "pyarrow/_flight.pyx":3248
 *     def wait(self):
 *         """Block until server is terminated with shutdown."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.server.get().Wait()
 * 
*/
  {
      PyThreadState * _save;
      _save = PyEval_SaveThread();
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pyarrow/_flight.pyx":3249
 *         """Block until server is terminated with shutdown."""
 *         with nogil:
 *             self.server.get().Wait()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
        (void)(__pyx_v_self->server.get()->Wait());
      }

      /* "pyarrow/_flight.pyx":3248
 *     def wait(self):
 *         """Block until server is terminated with shutdown."""
 *         with nogil:             # <<<<<<<<<<<<<<
 *             self.server.get().Wait()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          PyEval_RestoreThread(_save);
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/_flight.pyx":3246
 *             check_flight_status(self.server.get().Shutdown())
 * 
 *     def wait(self):             # <<<<<<<<<<<<<<
 *         """Block until server is terminated with shutdown."""
 *         with nogil:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/_flight.pyx":3251
 *             self.server.get().Wait()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_27__enter__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_26__enter__, "FlightServerBase.__enter__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_27__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_27__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_26__enter__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_27__enter__(PyObject *__pyx_v_self, 
#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("__enter__ (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("__enter__", 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("__enter__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_26__enter__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_26__enter__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "pyarrow/_flight.pyx":3252
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":3251
 *             self.server.get().Wait()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/

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

/* "pyarrow/_flight.pyx":3254
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.finalizer:
 *             self.finalizer()
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_29__exit__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_28__exit__, "FlightServerBase.__exit__(self, exc_type, exc_value, traceback)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_29__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_29__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_28__exit__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_29__exit__(PyObject *__pyx_v_self, 
#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_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 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("__exit__ (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_exc_type,&__pyx_mstate_global->__pyx_n_u_exc_value,&__pyx_mstate_global->__pyx_n_u_traceback,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, 3254, __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, 3254, __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, 3254, __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, 3254, __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, "__exit__", 0) < (0)) __PYX_ERR(0, 3254, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, i); __PYX_ERR(0, 3254, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 3254, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3254, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3254, __pyx_L3_error)
    }
    __pyx_v_exc_type = values[0];
    __pyx_v_exc_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 3254, __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("pyarrow._flight.FlightServerBase.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_28__exit__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback);

  /* 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_7pyarrow_7_flight_16FlightServerBase_28__exit__(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "pyarrow/_flight.pyx":3255
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
 *         if self.finalizer:             # <<<<<<<<<<<<<<
 *             self.finalizer()
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->finalizer); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3255, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/_flight.pyx":3256
 *     def __exit__(self, exc_type, exc_value, traceback):
 *         if self.finalizer:
 *             self.finalizer()             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_self->finalizer);
    __pyx_t_4 = __pyx_v_self->finalizer; 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(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((PyObject*)__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, 3256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/_flight.pyx":3255
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):
 *         if self.finalizer:             # <<<<<<<<<<<<<<
 *             self.finalizer()
 * 
*/
  }

  /* "pyarrow/_flight.pyx":3254
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.finalizer:
 *             self.finalizer()
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.__exit__", __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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__, "FlightServerBase.__reduce_cython__(self)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_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_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__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.server cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_server_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow._flight.FlightServerBase.__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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_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*/
PyDoc_STRVAR(__pyx_doc_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__, "FlightServerBase.__setstate_cython__(self, __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_16FlightServerBase_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__};
static PyObject *__pyx_pw_7pyarrow_7_flight_16FlightServerBase_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("pyarrow._flight.FlightServerBase.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__(((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)__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_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *__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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_self_server_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

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

/* "pyarrow/_flight.pyx":3259
 * 
 * 
 * def connect(location, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Connect to a Flight server.
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_3connect(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_7pyarrow_7_flight_2connect, "connect(location, **kwargs)\n\nConnect to a Flight server.\n\nParameters\n----------\nlocation : str, tuple, or Location\n    Location to connect to. Either a URI like \"grpc://localhost:port\",\n    a tuple of (host, port), or a Location instance.\ntls_root_certs : bytes or None\n    PEM-encoded.\ncert_chain: str or None\n    If provided, enables TLS mutual authentication.\nprivate_key: str or None\n    If provided, enables TLS mutual authentication.\noverride_hostname : str or None\n    Override the hostname checked by TLS. Insecure, use with caution.\nmiddleware : list or None\n    A list of ClientMiddlewareFactory instances to apply.\nwrite_size_limit_bytes : int or None\n    A soft limit on the size of a data payload sent to the\n    server. Enabled if positive. If enabled, writing a record\n    batch that (when serialized) exceeds this limit will raise an\n    exception; the client can retry the write with a smaller\n    batch.\ndisable_server_verification : boolean or None\n    Disable verifying the server when using TLS.\n    Insecure, use with caution.\ngeneric_options : list or None\n    A list of generic (string, int or string) options to pass to\n    the underlying transport.\n\nReturns\n-------\nclient : FlightClient");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_3connect = {"connect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_3connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_2connect};
static PyObject *__pyx_pw_7pyarrow_7_flight_3connect(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_location = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_location,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, 3259, __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, 3259, __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, __pyx_v_kwargs, values, kwd_pos_args, __pyx_kwds_len, "connect", 1) < (0)) __PYX_ERR(0, 3259, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("connect", 1, 1, 1, i); __PYX_ERR(0, 3259, __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, 3259, __pyx_L3_error)
    }
    __pyx_v_location = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3259, __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_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("pyarrow._flight.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_7_flight_2connect(__pyx_self, __pyx_v_location, __pyx_v_kwargs);

  /* 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_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7pyarrow_7_flight_2connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_location, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pyarrow/_flight.pyx":3295
 *     client : FlightClient
 *     """
 *     return FlightClient(location, **kwargs)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_location};
    __pyx_t_1 = __Pyx_PyObject_FastCallDict((PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
    __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, 3295, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/_flight.pyx":3259
 * 
 * 
 * def connect(location, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Connect to a Flight server.
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_5__pyx_unpickle_FlightError(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_7pyarrow_7_flight_4__pyx_unpickle_FlightError, "__pyx_unpickle_FlightError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_5__pyx_unpickle_FlightError = {"__pyx_unpickle_FlightError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_5__pyx_unpickle_FlightError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_4__pyx_unpickle_FlightError};
static PyObject *__pyx_pw_7pyarrow_7_flight_5__pyx_unpickle_FlightError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_4__pyx_unpickle_FlightError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_4__pyx_unpickle_FlightError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightError__set_state(FlightError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightError__set_state(FlightError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightError__set_state(FlightError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightError__set_state(FlightError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightError__set_state(<FlightError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightError__set_state(FlightError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightInternalError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_7__pyx_unpickle_FlightInternalError(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_7pyarrow_7_flight_6__pyx_unpickle_FlightInternalError, "__pyx_unpickle_FlightInternalError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_7__pyx_unpickle_FlightInternalError = {"__pyx_unpickle_FlightInternalError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_7__pyx_unpickle_FlightInternalError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6__pyx_unpickle_FlightInternalError};
static PyObject *__pyx_pw_7pyarrow_7_flight_7__pyx_unpickle_FlightInternalError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightInternalError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightInternalError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightInternalError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightInternalError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightInternalError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_6__pyx_unpickle_FlightInternalError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_6__pyx_unpickle_FlightInternalError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightInternalError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightInternalError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightInternalError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightInternalError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInternalError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightInternalError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightInternalError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightInternalError__set_state(FlightInternalError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightInternalError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightInternalError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightInternalError__set_state(FlightInternalError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightInternalError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightInternalError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightInternalError__set_state(FlightInternalError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightInternalError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightInternalError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightInternalError__set_state(FlightInternalError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightInternalError__set_state(<FlightInternalError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightInternalError__set_state(FlightInternalError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightTimedOutError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_9__pyx_unpickle_FlightTimedOutError(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_7pyarrow_7_flight_8__pyx_unpickle_FlightTimedOutError, "__pyx_unpickle_FlightTimedOutError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_9__pyx_unpickle_FlightTimedOutError = {"__pyx_unpickle_FlightTimedOutError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9__pyx_unpickle_FlightTimedOutError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8__pyx_unpickle_FlightTimedOutError};
static PyObject *__pyx_pw_7pyarrow_7_flight_9__pyx_unpickle_FlightTimedOutError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightTimedOutError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightTimedOutError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightTimedOutError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightTimedOutError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightTimedOutError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_8__pyx_unpickle_FlightTimedOutError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_8__pyx_unpickle_FlightTimedOutError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightTimedOutError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightTimedOutError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightTimedOutError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightTimedOutError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightTimedOutError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightTimedOutError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightTimedOutError__set_state(FlightTimedOutError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightTimedOutError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightTimedOutError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightTimedOutError__set_state(FlightTimedOutError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightTimedOutError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightTimedOutError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightTimedOutError__set_state(FlightTimedOutError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightTimedOutError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightTimedOutError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightTimedOutError__set_state(FlightTimedOutError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightTimedOutError__set_state(<FlightTimedOutError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightTimedOutError__set_state(FlightTimedOutError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightCancelledError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_11__pyx_unpickle_FlightCancelledError(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_7pyarrow_7_flight_10__pyx_unpickle_FlightCancelledError, "__pyx_unpickle_FlightCancelledError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_11__pyx_unpickle_FlightCancelledError = {"__pyx_unpickle_FlightCancelledError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11__pyx_unpickle_FlightCancelledError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10__pyx_unpickle_FlightCancelledError};
static PyObject *__pyx_pw_7pyarrow_7_flight_11__pyx_unpickle_FlightCancelledError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightCancelledError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightCancelledError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightCancelledError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightCancelledError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightCancelledError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_10__pyx_unpickle_FlightCancelledError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_10__pyx_unpickle_FlightCancelledError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightCancelledError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightCancelledError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightCancelledError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightCancelledError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightCancelledError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightCancelledError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightCancelledError__set_state(FlightCancelledError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightCancelledError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightCancelledError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightCancelledError__set_state(FlightCancelledError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightCancelledError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightCancelledError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightCancelledError__set_state(FlightCancelledError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightCancelledError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightCancelledError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightCancelledError__set_state(FlightCancelledError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightCancelledError__set_state(<FlightCancelledError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightCancelledError__set_state(FlightCancelledError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightServerError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_13__pyx_unpickle_FlightServerError(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_7pyarrow_7_flight_12__pyx_unpickle_FlightServerError, "__pyx_unpickle_FlightServerError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_13__pyx_unpickle_FlightServerError = {"__pyx_unpickle_FlightServerError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_13__pyx_unpickle_FlightServerError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12__pyx_unpickle_FlightServerError};
static PyObject *__pyx_pw_7pyarrow_7_flight_13__pyx_unpickle_FlightServerError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightServerError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightServerError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightServerError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightServerError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightServerError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_12__pyx_unpickle_FlightServerError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_12__pyx_unpickle_FlightServerError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightServerError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightServerError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightServerError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightServerError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightServerError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightServerError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightServerError__set_state(FlightServerError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightServerError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightServerError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightServerError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightServerError__set_state(FlightServerError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightServerError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightServerError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightServerError__set_state(FlightServerError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightServerError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightServerError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightServerError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightServerError__set_state(FlightServerError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightServerError__set_state(<FlightServerError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightServerError__set_state(FlightServerError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnauthenticatedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_15__pyx_unpickle_FlightUnauthenticatedError(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_7pyarrow_7_flight_14__pyx_unpickle_FlightUnauthenticatedError, "__pyx_unpickle_FlightUnauthenticatedError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_15__pyx_unpickle_FlightUnauthenticatedError = {"__pyx_unpickle_FlightUnauthenticatedError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_15__pyx_unpickle_FlightUnauthenticatedError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14__pyx_unpickle_FlightUnauthenticatedError};
static PyObject *__pyx_pw_7pyarrow_7_flight_15__pyx_unpickle_FlightUnauthenticatedError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthenticatedError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightUnauthenticatedError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnauthenticatedError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnauthenticatedError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightUnauthenticatedError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_14__pyx_unpickle_FlightUnauthenticatedError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_14__pyx_unpickle_FlightUnauthenticatedError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthenticatedError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightUnauthenticatedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightUnauthenticatedError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthenticatedError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthenticatedError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightUnauthenticatedError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthenticatedError__set_state(FlightUnauthenticatedError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthenticatedError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthenticatedError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightUnauthenticatedError__set_state(FlightUnauthenticatedError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnauthenticatedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightUnauthenticatedError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthenticatedError__set_state(FlightUnauthenticatedError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthenticatedError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthenticatedError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthenticatedError__set_state(FlightUnauthenticatedError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnauthenticatedError__set_state(<FlightUnauthenticatedError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthenticatedError__set_state(FlightUnauthenticatedError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnauthorizedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_17__pyx_unpickle_FlightUnauthorizedError(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_7pyarrow_7_flight_16__pyx_unpickle_FlightUnauthorizedError, "__pyx_unpickle_FlightUnauthorizedError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_17__pyx_unpickle_FlightUnauthorizedError = {"__pyx_unpickle_FlightUnauthorizedError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17__pyx_unpickle_FlightUnauthorizedError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16__pyx_unpickle_FlightUnauthorizedError};
static PyObject *__pyx_pw_7pyarrow_7_flight_17__pyx_unpickle_FlightUnauthorizedError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthorizedError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightUnauthorizedError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnauthorizedError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnauthorizedError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightUnauthorizedError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_16__pyx_unpickle_FlightUnauthorizedError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_16__pyx_unpickle_FlightUnauthorizedError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthorizedError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightUnauthorizedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightUnauthorizedError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthorizedError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthorizedError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightUnauthorizedError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthorizedError__set_state(FlightUnauthorizedError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthorizedError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnauthorizedError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightUnauthorizedError__set_state(FlightUnauthorizedError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnauthorizedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightUnauthorizedError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthorizedError__set_state(FlightUnauthorizedError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnauthorizedError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnauthorizedError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthorizedError__set_state(FlightUnauthorizedError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnauthorizedError__set_state(<FlightUnauthorizedError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnauthorizedError__set_state(FlightUnauthorizedError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnavailableError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_19__pyx_unpickle_FlightUnavailableError(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_7pyarrow_7_flight_18__pyx_unpickle_FlightUnavailableError, "__pyx_unpickle_FlightUnavailableError(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_19__pyx_unpickle_FlightUnavailableError = {"__pyx_unpickle_FlightUnavailableError", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19__pyx_unpickle_FlightUnavailableError, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18__pyx_unpickle_FlightUnavailableError};
static PyObject *__pyx_pw_7pyarrow_7_flight_19__pyx_unpickle_FlightUnavailableError(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnavailableError (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightUnavailableError", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnavailableError", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightUnavailableError", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightUnavailableError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_18__pyx_unpickle_FlightUnavailableError(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_18__pyx_unpickle_FlightUnavailableError(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnavailableError", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightUnavailableError(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightUnavailableError.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnavailableError.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnavailableError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightUnavailableError.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnavailableError__set_state(FlightUnavailableError __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnavailableError__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightUnavailableError.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightUnavailableError__set_state(FlightUnavailableError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnavailableError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightUnavailableError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnavailableError__set_state(FlightUnavailableError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightUnavailableError__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightUnavailableError__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnavailableError__set_state(FlightUnavailableError __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightUnavailableError__set_state(<FlightUnavailableError> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightUnavailableError__set_state(FlightUnavailableError __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AsyncioFlightClient(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_21__pyx_unpickle_AsyncioFlightClient(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_7pyarrow_7_flight_20__pyx_unpickle_AsyncioFlightClient, "__pyx_unpickle_AsyncioFlightClient(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_21__pyx_unpickle_AsyncioFlightClient = {"__pyx_unpickle_AsyncioFlightClient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_21__pyx_unpickle_AsyncioFlightClient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20__pyx_unpickle_AsyncioFlightClient};
static PyObject *__pyx_pw_7pyarrow_7_flight_21__pyx_unpickle_AsyncioFlightClient(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_AsyncioFlightClient (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_AsyncioFlightClient", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AsyncioFlightClient", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AsyncioFlightClient", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_AsyncioFlightClient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_20__pyx_unpickle_AsyncioFlightClient(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_20__pyx_unpickle_AsyncioFlightClient(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_AsyncioFlightClient", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_AsyncioFlightClient(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')             # <<<<<<<<<<<<<<
 *     __pyx_result = AsyncioFlightClient.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, __pyx_k_client_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
 *     __pyx_result = AsyncioFlightClient.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
 *     __pyx_result = AsyncioFlightClient.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = AsyncioFlightClient.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_AsyncioFlightClient__set_state(((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
 *     __pyx_result = AsyncioFlightClient.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):
 *     __pyx_result._client = __pyx_state[0]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AsyncioFlightClient(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_AsyncioFlightClient", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._client = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_AsyncioFlightClient__set_state(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  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("__pyx_unpickle_AsyncioFlightClient__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):
 *     __pyx_result._client = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient))))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->_client);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->_client);
  __pyx_v___pyx_result->_client = ((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):
 *     __pyx_result._client = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_AsyncioFlightClient__set_state(<AsyncioFlightClient> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_AsyncioFlightClient__set_state(AsyncioFlightClient __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result._client = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightDataStream(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_23__pyx_unpickle_FlightDataStream(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_7pyarrow_7_flight_22__pyx_unpickle_FlightDataStream, "__pyx_unpickle_FlightDataStream(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_23__pyx_unpickle_FlightDataStream = {"__pyx_unpickle_FlightDataStream", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23__pyx_unpickle_FlightDataStream, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22__pyx_unpickle_FlightDataStream};
static PyObject *__pyx_pw_7pyarrow_7_flight_23__pyx_unpickle_FlightDataStream(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightDataStream (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_FlightDataStream", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightDataStream", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_FlightDataStream", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_FlightDataStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_22__pyx_unpickle_FlightDataStream(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_22__pyx_unpickle_FlightDataStream(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightDataStream", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_FlightDataStream(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = FlightDataStream.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightDataStream.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightDataStream.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = FlightDataStream.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightDataStream__set_state(FlightDataStream __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightDataStream__set_state(((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = FlightDataStream.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_FlightDataStream__set_state(FlightDataStream __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightDataStream(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_FlightDataStream", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightDataStream__set_state(FlightDataStream __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_FlightDataStream__set_state(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_FlightDataStream__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightDataStream__set_state(FlightDataStream __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_FlightDataStream__set_state(<FlightDataStream> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_FlightDataStream__set_state(FlightDataStream __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_25__pyx_unpickle_ServerAuthHandler(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_7pyarrow_7_flight_24__pyx_unpickle_ServerAuthHandler, "__pyx_unpickle_ServerAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_25__pyx_unpickle_ServerAuthHandler = {"__pyx_unpickle_ServerAuthHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25__pyx_unpickle_ServerAuthHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24__pyx_unpickle_ServerAuthHandler};
static PyObject *__pyx_pw_7pyarrow_7_flight_25__pyx_unpickle_ServerAuthHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerAuthHandler (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ServerAuthHandler", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerAuthHandler", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerAuthHandler", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ServerAuthHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_24__pyx_unpickle_ServerAuthHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_24__pyx_unpickle_ServerAuthHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerAuthHandler", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ServerAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ServerAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerAuthHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ServerAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerAuthHandler__set_state(ServerAuthHandler __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerAuthHandler__set_state(((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ServerAuthHandler__set_state(ServerAuthHandler __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ServerAuthHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerAuthHandler__set_state(ServerAuthHandler __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerAuthHandler__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerAuthHandler__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerAuthHandler__set_state(ServerAuthHandler __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ServerAuthHandler__set_state(<ServerAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerAuthHandler__set_state(ServerAuthHandler __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_27__pyx_unpickle_ClientAuthHandler(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_7pyarrow_7_flight_26__pyx_unpickle_ClientAuthHandler, "__pyx_unpickle_ClientAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_27__pyx_unpickle_ClientAuthHandler = {"__pyx_unpickle_ClientAuthHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_27__pyx_unpickle_ClientAuthHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26__pyx_unpickle_ClientAuthHandler};
static PyObject *__pyx_pw_7pyarrow_7_flight_27__pyx_unpickle_ClientAuthHandler(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientAuthHandler (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ClientAuthHandler", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientAuthHandler", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientAuthHandler", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ClientAuthHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_26__pyx_unpickle_ClientAuthHandler(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_26__pyx_unpickle_ClientAuthHandler(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientAuthHandler", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ClientAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ClientAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientAuthHandler.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ClientAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientAuthHandler__set_state(ClientAuthHandler __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientAuthHandler__set_state(((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientAuthHandler.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ClientAuthHandler__set_state(ClientAuthHandler __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ClientAuthHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientAuthHandler__set_state(ClientAuthHandler __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientAuthHandler__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientAuthHandler__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientAuthHandler__set_state(ClientAuthHandler __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ClientAuthHandler__set_state(<ClientAuthHandler> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientAuthHandler__set_state(ClientAuthHandler __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_29__pyx_unpickle_ClientMiddlewareFactory(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_7pyarrow_7_flight_28__pyx_unpickle_ClientMiddlewareFactory, "__pyx_unpickle_ClientMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_29__pyx_unpickle_ClientMiddlewareFactory = {"__pyx_unpickle_ClientMiddlewareFactory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_29__pyx_unpickle_ClientMiddlewareFactory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_28__pyx_unpickle_ClientMiddlewareFactory};
static PyObject *__pyx_pw_7pyarrow_7_flight_29__pyx_unpickle_ClientMiddlewareFactory(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddlewareFactory (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ClientMiddlewareFactory", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientMiddlewareFactory", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientMiddlewareFactory", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ClientMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_28__pyx_unpickle_ClientMiddlewareFactory(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_28__pyx_unpickle_ClientMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddlewareFactory", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ClientMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ClientMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddlewareFactory.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ClientMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddlewareFactory__set_state(ClientMiddlewareFactory __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddlewareFactory__set_state(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ClientMiddlewareFactory__set_state(ClientMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ClientMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddlewareFactory__set_state(ClientMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddlewareFactory__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddlewareFactory__set_state(ClientMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ClientMiddlewareFactory__set_state(<ClientMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddlewareFactory__set_state(ClientMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_31__pyx_unpickle_ClientMiddleware(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_7pyarrow_7_flight_30__pyx_unpickle_ClientMiddleware, "__pyx_unpickle_ClientMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_31__pyx_unpickle_ClientMiddleware = {"__pyx_unpickle_ClientMiddleware", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31__pyx_unpickle_ClientMiddleware, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_30__pyx_unpickle_ClientMiddleware};
static PyObject *__pyx_pw_7pyarrow_7_flight_31__pyx_unpickle_ClientMiddleware(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddleware (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ClientMiddleware", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientMiddleware", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ClientMiddleware", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ClientMiddleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_30__pyx_unpickle_ClientMiddleware(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_30__pyx_unpickle_ClientMiddleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddleware", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ClientMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ClientMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddleware.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ClientMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddleware__set_state(ClientMiddleware __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddleware__set_state(((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ClientMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ClientMiddleware__set_state(ClientMiddleware __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ClientMiddleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddleware__set_state(ClientMiddleware __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ClientMiddleware__set_state(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ClientMiddleware__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddleware__set_state(ClientMiddleware __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ClientMiddleware__set_state(<ClientMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ClientMiddleware__set_state(ClientMiddleware __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_33__pyx_unpickle_ServerMiddlewareFactory(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_7pyarrow_7_flight_32__pyx_unpickle_ServerMiddlewareFactory, "__pyx_unpickle_ServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_33__pyx_unpickle_ServerMiddlewareFactory = {"__pyx_unpickle_ServerMiddlewareFactory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_33__pyx_unpickle_ServerMiddlewareFactory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_32__pyx_unpickle_ServerMiddlewareFactory};
static PyObject *__pyx_pw_7pyarrow_7_flight_33__pyx_unpickle_ServerMiddlewareFactory(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddlewareFactory (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ServerMiddlewareFactory", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerMiddlewareFactory", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerMiddlewareFactory", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ServerMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_32__pyx_unpickle_ServerMiddlewareFactory(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_32__pyx_unpickle_ServerMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddlewareFactory", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddlewareFactory.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddlewareFactory__set_state(ServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddlewareFactory__set_state(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ServerMiddlewareFactory__set_state(ServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ServerMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddlewareFactory__set_state(ServerMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddlewareFactory__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddlewareFactory__set_state(ServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ServerMiddlewareFactory__set_state(<ServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddlewareFactory__set_state(ServerMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_TracingServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_35__pyx_unpickle_TracingServerMiddlewareFactory(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_7pyarrow_7_flight_34__pyx_unpickle_TracingServerMiddlewareFactory, "__pyx_unpickle_TracingServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_35__pyx_unpickle_TracingServerMiddlewareFactory = {"__pyx_unpickle_TracingServerMiddlewareFactory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_35__pyx_unpickle_TracingServerMiddlewareFactory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_34__pyx_unpickle_TracingServerMiddlewareFactory};
static PyObject *__pyx_pw_7pyarrow_7_flight_35__pyx_unpickle_TracingServerMiddlewareFactory(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_TracingServerMiddlewareFactory (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_TracingServerMiddlewareFactory", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TracingServerMiddlewareFactory", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TracingServerMiddlewareFactory", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_TracingServerMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_34__pyx_unpickle_TracingServerMiddlewareFactory(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_34__pyx_unpickle_TracingServerMiddlewareFactory(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_TracingServerMiddlewareFactory", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_TracingServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = TracingServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = TracingServerMiddlewareFactory.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = TracingServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = TracingServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_TracingServerMiddlewareFactory__set_state(TracingServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_TracingServerMiddlewareFactory__set_state(((struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = TracingServerMiddlewareFactory.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_TracingServerMiddlewareFactory__set_state(TracingServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_TracingServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_TracingServerMiddlewareFactory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_TracingServerMiddlewareFactory__set_state(TracingServerMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_TracingServerMiddlewareFactory__set_state(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_TracingServerMiddlewareFactory__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_TracingServerMiddlewareFactory__set_state(TracingServerMiddlewareFactory __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_TracingServerMiddlewareFactory__set_state(<TracingServerMiddlewareFactory> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_TracingServerMiddlewareFactory__set_state(TracingServerMiddlewareFactory __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_37__pyx_unpickle_ServerMiddleware(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_7pyarrow_7_flight_36__pyx_unpickle_ServerMiddleware, "__pyx_unpickle_ServerMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_37__pyx_unpickle_ServerMiddleware = {"__pyx_unpickle_ServerMiddleware", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_37__pyx_unpickle_ServerMiddleware, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_36__pyx_unpickle_ServerMiddleware};
static PyObject *__pyx_pw_7pyarrow_7_flight_37__pyx_unpickle_ServerMiddleware(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddleware (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle_ServerMiddleware", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerMiddleware", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ServerMiddleware", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle_ServerMiddleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_36__pyx_unpickle_ServerMiddleware(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_36__pyx_unpickle_ServerMiddleware(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddleware", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_ServerMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')             # <<<<<<<<<<<<<<
 *     __pyx_result = ServerMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, __pyx_k__5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddleware.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = ServerMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddleware__set_state(ServerMiddleware __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddleware__set_state(((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
 *     __pyx_result = ServerMiddleware.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ServerMiddleware__set_state(ServerMiddleware __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle_ServerMiddleware", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddleware__set_state(ServerMiddleware __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle_ServerMiddleware__set_state(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ServerMiddleware__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddleware__set_state(ServerMiddleware __pyx_result, __pyx_state: tuple):
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_ServerMiddleware__set_state(<ServerMiddleware> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ServerMiddleware__set_state(ServerMiddleware __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 0)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__ServerMiddlewareFactoryWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_39__pyx_unpickle__ServerMiddlewareFactoryWrapper(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_7pyarrow_7_flight_38__pyx_unpickle__ServerMiddlewareFactoryWrapper, "__pyx_unpickle__ServerMiddlewareFactoryWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_39__pyx_unpickle__ServerMiddlewareFactoryWrapper = {"__pyx_unpickle__ServerMiddlewareFactoryWrapper", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_39__pyx_unpickle__ServerMiddlewareFactoryWrapper, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_38__pyx_unpickle__ServerMiddlewareFactoryWrapper};
static PyObject *__pyx_pw_7pyarrow_7_flight_39__pyx_unpickle__ServerMiddlewareFactoryWrapper(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__ServerMiddlewareFactoryWrapper (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle__ServerMiddlewareFactoryWrapper", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__ServerMiddlewareFactoryWrapper", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__ServerMiddlewareFactoryWrapper", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle__ServerMiddlewareFactoryWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_38__pyx_unpickle__ServerMiddlewareFactoryWrapper(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_38__pyx_unpickle__ServerMiddlewareFactoryWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__ServerMiddlewareFactoryWrapper", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle__ServerMiddlewareFactoryWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')             # <<<<<<<<<<<<<<
 *     __pyx_result = _ServerMiddlewareFactoryWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, __pyx_k_factories); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')
 *     __pyx_result = _ServerMiddlewareFactoryWrapper.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')
 *     __pyx_result = _ServerMiddlewareFactoryWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = _ServerMiddlewareFactoryWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')
 *     __pyx_result = _ServerMiddlewareFactoryWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.factories = __pyx_state[0]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__ServerMiddlewareFactoryWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe0e1e06, 0x224d5bf, 0x0f695c4, b'factories')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle__ServerMiddlewareFactoryWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.factories = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  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("__pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.factories = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->factories);
  __Pyx_DECREF(__pyx_v___pyx_result->factories);
  __pyx_v___pyx_result->factories = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.factories = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(<_ServerMiddlewareFactoryWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(_ServerMiddlewareFactoryWrapper __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.factories = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

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

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__ServerMiddlewareWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
*/

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_7_flight_41__pyx_unpickle__ServerMiddlewareWrapper(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_7pyarrow_7_flight_40__pyx_unpickle__ServerMiddlewareWrapper, "__pyx_unpickle__ServerMiddlewareWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state)");
static PyMethodDef __pyx_mdef_7pyarrow_7_flight_41__pyx_unpickle__ServerMiddlewareWrapper = {"__pyx_unpickle__ServerMiddlewareWrapper", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_41__pyx_unpickle__ServerMiddlewareWrapper, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_40__pyx_unpickle__ServerMiddlewareWrapper};
static PyObject *__pyx_pw_7pyarrow_7_flight_41__pyx_unpickle__ServerMiddlewareWrapper(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle__ServerMiddlewareWrapper (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_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__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, 4, __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(1, 4, __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(1, 4, __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(1, 4, __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, "__pyx_unpickle__ServerMiddlewareWrapper", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__ServerMiddlewareWrapper", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      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, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__ServerMiddlewareWrapper", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __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("pyarrow._flight.__pyx_unpickle__ServerMiddlewareWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_7_flight_40__pyx_unpickle__ServerMiddlewareWrapper(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* 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_7pyarrow_7_flight_40__pyx_unpickle__ServerMiddlewareWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle__ServerMiddlewareWrapper", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle__ServerMiddlewareWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')             # <<<<<<<<<<<<<<
 *     __pyx_result = _ServerMiddlewareWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, __pyx_k_middleware); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
 *     __pyx_result = _ServerMiddlewareWrapper.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
 *     __pyx_result = _ServerMiddlewareWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = _ServerMiddlewareWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(1, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareWrapper__set_state(((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
 *     __pyx_result = _ServerMiddlewareWrapper.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.middleware = __pyx_state[0]
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__ServerMiddlewareWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle__ServerMiddlewareWrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.middleware = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

static PyObject *__pyx_f_7pyarrow_7_flight___pyx_unpickle__ServerMiddlewareWrapper__set_state(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  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("__pyx_unpickle__ServerMiddlewareWrapper__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.middleware = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->middleware);
  __Pyx_DECREF(__pyx_v___pyx_result->middleware);
  __pyx_v___pyx_result->middleware = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):
 *     __pyx_result.middleware = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle__ServerMiddlewareWrapper__set_state(<_ServerMiddlewareWrapper> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle__ServerMiddlewareWrapper__set_state(_ServerMiddlewareWrapper __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.middleware = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow._flight.__pyx_unpickle__ServerMiddlewareWrapper__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
static struct __pyx_vtabstruct_7pyarrow_7_flight_FlightCallOptions __pyx_vtable_7pyarrow_7_flight_FlightCallOptions;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightCallOptions(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightCallOptions;
  __Pyx_default_placement_construct(&(p->options));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightCallOptions(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *p = (struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightCallOptions) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->options);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightCallOptions);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_timeout(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7timeout_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_headers(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7headers_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_read_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_12read_options_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_write_options(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_13write_options_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightCallOptions[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightCallOptions_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightCallOptions_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightCallOptions[] = {
  {"timeout", __pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_timeout, 0, PyDoc_STR("Get timeout for the call (in seconds)\n        "), 0},
  {"headers", __pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_headers, 0, PyDoc_STR("Get list of headers (key, value tuples) for client's context\n        "), 0},
  {"read_options", __pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_read_options, 0, PyDoc_STR("Get serialization options for reading IPC format\n        "), 0},
  {"write_options", __pyx_getprop_7pyarrow_7_flight_17FlightCallOptions_write_options, 0, PyDoc_STR("Get IPC write options\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightCallOptions_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightCallOptions},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_3__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("FlightCallOptions(timeout=None, write_options=None, headers=None, IpcReadOptions read_options=None)\n\nRPC-layer options for a Flight call.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightCallOptions},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightCallOptions},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_17FlightCallOptions_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightCallOptions},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightCallOptions_spec = {
  "pyarrow._flight.FlightCallOptions",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightCallOptions_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightCallOptions = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightCallOptions", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightCallOptions, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_17FlightCallOptions_3__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("FlightCallOptions(timeout=None, write_options=None, headers=None, IpcReadOptions read_options=None)\n\nRPC-layer options for a Flight call."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightCallOptions, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightCallOptions, /*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_7pyarrow_7_flight_17FlightCallOptions_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightCallOptions, /*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 !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_7pyarrow_7_flight_FlightError __pyx_vtable_7pyarrow_7_flight_FlightError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightError *p;
  PyObject *o = __Pyx_PyType_GetSlot((((PyTypeObject*)PyExc_Exception)), tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightError *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightError;
  p->__dict__ = PyDict_New(); if (unlikely(!p->__dict__)) goto bad;return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightError(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightError *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight_FlightError) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__dict__) PyDict_Clear(p->__dict__);
  Py_CLEAR(p->__dict__);
  PyObject_GC_Track(o);
  __Pyx_PyType_GetSlot((((PyTypeObject*)PyExc_Exception)), tp_dealloc, destructor)(o);
}

static int __pyx_tp_traverse_7pyarrow_7_flight_FlightError(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight_FlightError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightError *)o;
  {
    traverseproc traverse = __Pyx_PyType_GetSlot((((PyTypeObject*)PyExc_Exception)), tp_traverse, traverseproc);
    if (!traverse); else { e = traverse(o,v,a); if (e) return e; }
  }
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->__dict__) {
    e = (*v)(p->__dict__, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight_FlightError(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight_FlightError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightError *)o;
  {
    inquiry clear = __Pyx_PyType_GetSlot((((PyTypeObject*)PyExc_Exception)), tp_clear, inquiry);
    if (clear) clear(o);
  }
  tmp = ((PyObject*)p->__dict__);
  p->__dict__ = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightError *)o;
  if (unlikely(!p->__dict__)){
    p->__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__dict__);
  return p->__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11FlightError_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11FlightError_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_11FlightError_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_11FlightError_4__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightError, __dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("FlightError(message='', extra_info=b'')\n\nThe base class for Flight-specific errors.\n\nA server may raise this class or one of its subclasses to provide\na more detailed error to clients.\n\nParameters\n----------\nmessage : str, optional\n    The error message.\nextra_info : bytes, optional\n    Extra binary error details that were provided by the\n    server/will be sent to the client.\n\nAttributes\n----------\nextra_info : bytes\n    Extra binary error details that were provided by the\n    server/will be sent to the client.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightError, __dict__)},
  #endif
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_11FlightError_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightError_spec = {
  "pyarrow._flight.FlightError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightError),
  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_7pyarrow_7_flight_FlightError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("FlightError(message='', extra_info=b'')\n\nThe base class for Flight-specific errors.\n\nA server may raise this class or one of its subclasses to provide\na more detailed error to clients.\n\nParameters\n----------\nmessage : str, optional\n    The error message.\nextra_info : bytes, optional\n    Extra binary error details that were provided by the\n    server/will be sent to the client.\n\nAttributes\n----------\nextra_info : bytes\n    Extra binary error details that were provided by the\n    server/will be sent to the client."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightError, __dict__), /*tp_dictoffset*/
  #endif
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightError, /*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 !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_7pyarrow_7_flight_FlightInternalError __pyx_vtable_7pyarrow_7_flight_FlightInternalError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightInternalError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightInternalError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightInternalError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightInternalError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightInternalError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightInternalError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightInternalError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightInternalError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightInternalError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightInternalError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightInternalError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightInternalError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightInternalError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("An error internal to the Flight server occurred.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightInternalError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightInternalError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightInternalError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightInternalError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightInternalError_spec = {
  "pyarrow._flight.FlightInternalError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError),
  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_7pyarrow_7_flight_FlightInternalError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightInternalError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightInternalError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("An error internal to the Flight server occurred."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightInternalError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightInternalError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightInternalError, /*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 !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_7pyarrow_7_flight_FlightTimedOutError __pyx_vtable_7pyarrow_7_flight_FlightTimedOutError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightTimedOutError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightTimedOutError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightTimedOutError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightTimedOutError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightTimedOutError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightTimedOutError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19FlightTimedOutError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightTimedOutError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightTimedOutError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightTimedOutError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightTimedOutError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("The Flight RPC call timed out.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightTimedOutError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightTimedOutError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightTimedOutError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightTimedOutError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightTimedOutError_spec = {
  "pyarrow._flight.FlightTimedOutError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError),
  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_7pyarrow_7_flight_FlightTimedOutError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightTimedOutError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightTimedOutError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The Flight RPC call timed out."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightTimedOutError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightTimedOutError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightTimedOutError, /*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 !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_7pyarrow_7_flight_FlightCancelledError __pyx_vtable_7pyarrow_7_flight_FlightCancelledError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightCancelledError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightCancelledError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightCancelledError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightCancelledError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightCancelledError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightCancelledError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightCancelledError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightCancelledError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightCancelledError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightCancelledError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightCancelledError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("The operation was cancelled.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightCancelledError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightCancelledError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightCancelledError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightCancelledError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightCancelledError_spec = {
  "pyarrow._flight.FlightCancelledError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError),
  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_7pyarrow_7_flight_FlightCancelledError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightCancelledError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightCancelledError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The operation was cancelled."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightCancelledError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightCancelledError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightCancelledError, /*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 !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_7pyarrow_7_flight_FlightServerError __pyx_vtable_7pyarrow_7_flight_FlightServerError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightServerError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightServerError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightServerError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightServerError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightServerError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightServerError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightServerError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightServerError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightServerError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightServerError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightServerError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightServerError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightServerError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightServerError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightServerError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightServerError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("A server error occurred.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightServerError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightServerError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightServerError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightServerError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightServerError_spec = {
  "pyarrow._flight.FlightServerError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError),
  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_7pyarrow_7_flight_FlightServerError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightServerError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightServerError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("A server error occurred."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightServerError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightServerError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightServerError, /*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 !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_7pyarrow_7_flight_FlightUnauthenticatedError __pyx_vtable_7pyarrow_7_flight_FlightUnauthenticatedError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnauthenticatedError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightUnauthenticatedError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightUnauthenticatedError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightUnauthenticatedError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightUnauthenticatedError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26FlightUnauthenticatedError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightUnauthenticatedError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightUnauthenticatedError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightUnauthenticatedError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("The client is not authenticated.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightUnauthenticatedError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightUnauthenticatedError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightUnauthenticatedError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightUnauthenticatedError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError_spec = {
  "pyarrow._flight.FlightUnauthenticatedError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError),
  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_7pyarrow_7_flight_FlightUnauthenticatedError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightUnauthenticatedError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The client is not authenticated."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightUnauthenticatedError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightUnauthenticatedError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightUnauthenticatedError, /*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 !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_7pyarrow_7_flight_FlightUnauthorizedError __pyx_vtable_7pyarrow_7_flight_FlightUnauthorizedError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnauthorizedError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightUnauthorizedError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightUnauthorizedError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightUnauthorizedError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightUnauthorizedError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23FlightUnauthorizedError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightUnauthorizedError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightUnauthorizedError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightUnauthorizedError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightUnauthorizedError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("The client is not authorized to perform the given operation.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightUnauthorizedError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightUnauthorizedError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightUnauthorizedError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightUnauthorizedError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightUnauthorizedError_spec = {
  "pyarrow._flight.FlightUnauthorizedError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError),
  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_7pyarrow_7_flight_FlightUnauthorizedError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightUnauthorizedError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightUnauthorizedError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The client is not authorized to perform the given operation."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightUnauthorizedError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightUnauthorizedError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightUnauthorizedError, /*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 !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_7pyarrow_7_flight_FlightUnavailableError __pyx_vtable_7pyarrow_7_flight_FlightUnavailableError;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightUnavailableError(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightError(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightError*)__pyx_vtabptr_7pyarrow_7_flight_FlightUnavailableError;
  return o;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightUnavailableError(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *p = (struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightUnavailableError PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightUnavailableError[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22FlightUnavailableError___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22FlightUnavailableError_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightUnavailableError[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightUnavailableError, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightUnavailableError[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightUnavailableError_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightError},
  {Py_tp_doc, (void *)PyDoc_STR("The server is not reachable or available.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightError},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightError},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightUnavailableError},
  {Py_tp_members, (void *)__pyx_tp_members_FlightUnavailableError},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightUnavailableError},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightUnavailableError},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightUnavailableError_spec = {
  "pyarrow._flight.FlightUnavailableError",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError),
  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_7pyarrow_7_flight_FlightUnavailableError_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightUnavailableError = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightUnavailableError", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightError, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The server is not reachable or available."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightError, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightError, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightUnavailableError, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightUnavailableError, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_11FlightError_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightUnavailableError, /*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 !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_7pyarrow_7_flight_Action __pyx_vtable_7pyarrow_7_flight_Action;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_Action(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_Action *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_Action *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_Action;
  __Pyx_default_placement_construct(&(p->action));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_Action(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_Action *p = (struct __pyx_obj_7pyarrow_7_flight_Action *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_Action) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->action);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_Action);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_Action(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_6Action_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_6Action_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_6Action_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_6Action_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_6Action_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_6Action_4body_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_Action[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Action_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Action_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_Action[] = {
  {"type", __pyx_getprop_7pyarrow_7_flight_6Action_type, 0, PyDoc_STR("The action type."), 0},
  {"body", __pyx_getprop_7pyarrow_7_flight_6Action_body, 0, PyDoc_STR("The action body (arguments for the action)."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_Action_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_Action},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_6Action_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("Action(action_type, buf)\n\nAn action executable on a Flight service.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_Action},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_Action},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_Action},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_6Action_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_Action},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_Action_spec = {
  "pyarrow._flight.Action",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Action),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_Action_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_Action = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""Action", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Action), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_Action, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_6Action_9__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("Action(action_type, buf)\n\nAn action executable on a Flight service."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_Action, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_Action, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_Action, /*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_7pyarrow_7_flight_6Action_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_Action, /*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 !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_7pyarrow_7_flight_Result(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_Result *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_Result *)o);
  __Pyx_default_placement_construct(&(p->result));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_Result(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_Result *p = (struct __pyx_obj_7pyarrow_7_flight_Result *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_Result) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->result);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_Result);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_Result(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_6Result_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_6Result_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_6Result_body(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_6Result_4body_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_Result[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Result_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Result_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_Result[] = {
  {"body", __pyx_getprop_7pyarrow_7_flight_6Result_body, 0, PyDoc_STR("Get the Buffer containing the result."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_Result_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_Result},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_6Result_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("Result(buf)\n\nA result from executing an Action.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_Result},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_Result},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_Result},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_6Result_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_Result},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_Result_spec = {
  "pyarrow._flight.Result",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Result),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_Result_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_Result = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""Result", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Result), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_Result, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_6Result_9__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("Result(buf)\n\nA result from executing an Action."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_Result, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_Result, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_Result, /*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_7pyarrow_7_flight_6Result_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_Result, /*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 !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_7pyarrow_7_flight_BasicAuth(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_BasicAuth *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)o);
  __Pyx_default_placement_construct(&(p->basic_auth));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_BasicAuth(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_BasicAuth *p = (struct __pyx_obj_7pyarrow_7_flight_BasicAuth *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_BasicAuth) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->basic_auth);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_BasicAuth);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_BasicAuth(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_9BasicAuth_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_9BasicAuth_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_9BasicAuth_username(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_9BasicAuth_8username_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_9BasicAuth_password(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_9BasicAuth_8password_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_BasicAuth[] = {
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_3deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_2deserialize},
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_5serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_4serialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_9BasicAuth_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_BasicAuth[] = {
  {"username", __pyx_getprop_7pyarrow_7_flight_9BasicAuth_username, 0, PyDoc_STR("Get the username."), 0},
  {"password", __pyx_getprop_7pyarrow_7_flight_9BasicAuth_password, 0, PyDoc_STR("Get the password."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_BasicAuth_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_BasicAuth},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_9BasicAuth_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("BasicAuth(username=None, password=None)\n\nA container for basic auth.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_BasicAuth},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_BasicAuth},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_BasicAuth},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_9BasicAuth_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_BasicAuth},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_BasicAuth_spec = {
  "pyarrow._flight.BasicAuth",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_BasicAuth),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_BasicAuth_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_BasicAuth = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""BasicAuth", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_BasicAuth), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_BasicAuth, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_9BasicAuth_9__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("BasicAuth(username=None, password=None)\n\nA container for basic auth."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_BasicAuth, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_BasicAuth, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_BasicAuth, /*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_7pyarrow_7_flight_9BasicAuth_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_BasicAuth, /*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 !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_7pyarrow_7_flight_FlightDescriptor __pyx_vtable_7pyarrow_7_flight_FlightDescriptor;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightDescriptor;
  __Pyx_default_placement_construct(&(p->descriptor));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightDescriptor(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *p = (struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightDescriptor) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->descriptor);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightDescriptor);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_FlightDescriptor(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_13__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_13__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_descriptor_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15descriptor_type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_command(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7command_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_4path_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightDescriptor[] = {
  {"for_path", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_3for_path, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_2for_path},
  {"for_command", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_5for_command, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_4for_command},
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_9serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_8serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_11deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_10deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDescriptor_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightDescriptor[] = {
  {"descriptor_type", __pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_descriptor_type, 0, PyDoc_STR("Get the type of this descriptor."), 0},
  {"command", __pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_command, 0, PyDoc_STR("Get the command for this descriptor."), 0},
  {"path", __pyx_getprop_7pyarrow_7_flight_16FlightDescriptor_path, 0, PyDoc_STR("Get the path for this descriptor."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightDescriptor_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightDescriptor},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("FlightDescriptor()\n\nA description of a data stream available from a Flight service.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_FlightDescriptor},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightDescriptor},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightDescriptor},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_16FlightDescriptor_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightDescriptor},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightDescriptor_spec = {
  "pyarrow._flight.FlightDescriptor",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightDescriptor_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightDescriptor = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightDescriptor", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightDescriptor, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_16FlightDescriptor_7__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("FlightDescriptor()\n\nA description of a data stream available from a Flight service."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_FlightDescriptor, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightDescriptor, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightDescriptor, /*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_7pyarrow_7_flight_16FlightDescriptor_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightDescriptor, /*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 !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_7pyarrow_7_flight_Ticket(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_Ticket *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_Ticket *)o);
  __Pyx_default_placement_construct(&(p->c_ticket));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_Ticket(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_Ticket *p = (struct __pyx_obj_7pyarrow_7_flight_Ticket *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_Ticket) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->c_ticket);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_Ticket);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_Ticket(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_6Ticket_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_6Ticket_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_6Ticket_ticket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_6Ticket_6ticket_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_Ticket[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_6Ticket_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_6Ticket_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_Ticket[] = {
  {"ticket", __pyx_getprop_7pyarrow_7_flight_6Ticket_ticket, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_Ticket_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_Ticket},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_6Ticket_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("Ticket(ticket)\n\nA ticket for requesting a Flight stream.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_Ticket},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_Ticket},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_Ticket},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_6Ticket_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_Ticket},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_Ticket_spec = {
  "pyarrow._flight.Ticket",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Ticket),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_Ticket_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_Ticket = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""Ticket", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Ticket), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_Ticket, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_6Ticket_9__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("Ticket(ticket)\n\nA ticket for requesting a Flight stream."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_Ticket, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_Ticket, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_Ticket, /*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_7pyarrow_7_flight_6Ticket_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_Ticket, /*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 !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_7pyarrow_7_flight_Location __pyx_vtable_7pyarrow_7_flight_Location;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_Location(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_Location *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_Location *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_Location;
  __Pyx_default_placement_construct(&(p->location));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_Location(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_Location *p = (struct __pyx_obj_7pyarrow_7_flight_Location *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_Location) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->location);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_Location);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_Location(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_8Location_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_8Location_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_8Location_uri(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_8Location_3uri_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_Location[] = {
  {"equals", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_5equals, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_4equals},
  {"for_grpc_tcp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_9for_grpc_tcp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_8for_grpc_tcp},
  {"for_grpc_tls", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_11for_grpc_tls, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_10for_grpc_tls},
  {"for_grpc_unix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_13for_grpc_unix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_12for_grpc_unix},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_15__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_8Location_17__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_8Location_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_Location[] = {
  {"uri", __pyx_getprop_7pyarrow_7_flight_8Location_uri, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_Location_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_Location},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_8Location_3__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("Location(uri)\n\nThe location of a Flight service.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_Location},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_Location},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_Location},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_8Location_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_Location},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_Location_spec = {
  "pyarrow._flight.Location",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Location),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_Location_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_Location = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""Location", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_Location), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_Location, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_8Location_3__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("Location(uri)\n\nThe location of a Flight service."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_Location, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_Location, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_Location, /*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_7pyarrow_7_flight_8Location_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_Location, /*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 !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_7pyarrow_7_flight_FlightEndpoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)o);
  __Pyx_default_placement_construct(&(p->endpoint));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightEndpoint(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *p = (struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightEndpoint) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->endpoint);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightEndpoint);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_FlightEndpoint(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_ticket(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_6ticket_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_locations(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_9locations_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_expiration_time(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_15expiration_time_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_app_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_12app_metadata_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightEndpoint[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_14FlightEndpoint_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightEndpoint[] = {
  {"ticket", __pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_ticket, 0, PyDoc_STR("Get the ticket in this endpoint."), 0},
  {"locations", __pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_locations, 0, PyDoc_STR("Get locations where this flight is available."), 0},
  {"expiration_time", __pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_expiration_time, 0, PyDoc_STR("Get the expiration time of this stream.\n\n        If present, clients may assume they can retry DoGet requests.\n        Otherwise, clients should avoid retrying DoGet requests.\n\n        "), 0},
  {"app_metadata", __pyx_getprop_7pyarrow_7_flight_14FlightEndpoint_app_metadata, 0, PyDoc_STR("Get application-defined opaque metadata."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightEndpoint_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightEndpoint},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_7__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("FlightEndpoint(ticket, locations, expiration_time=None, app_metadata='')\n\nA Flight stream, along with the ticket and locations to access it.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_FlightEndpoint},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightEndpoint},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightEndpoint},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_14FlightEndpoint_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightEndpoint},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightEndpoint_spec = {
  "pyarrow._flight.FlightEndpoint",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightEndpoint_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightEndpoint = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightEndpoint", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightEndpoint, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_14FlightEndpoint_7__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("FlightEndpoint(ticket, locations, expiration_time=None, app_metadata='')\n\nA Flight stream, along with the ticket and locations to access it."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_FlightEndpoint, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightEndpoint, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightEndpoint, /*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_7pyarrow_7_flight_14FlightEndpoint_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightEndpoint, /*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 !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_7pyarrow_7_flight_SchemaResult(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_SchemaResult *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)o);
  __Pyx_default_placement_construct(&(p->result));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_SchemaResult(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_SchemaResult *p = (struct __pyx_obj_7pyarrow_7_flight_SchemaResult *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_SchemaResult) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->result);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_SchemaResult);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_SchemaResult(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_12SchemaResult_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_12SchemaResult_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_12SchemaResult_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_12SchemaResult_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_SchemaResult[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12SchemaResult_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_SchemaResult[] = {
  {"schema", __pyx_getprop_7pyarrow_7_flight_12SchemaResult_schema, 0, PyDoc_STR("The schema of the data in this flight."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_SchemaResult_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_SchemaResult},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_12SchemaResult_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("SchemaResult(Schema schema)\n\nThe serialized schema returned from a GetSchema request.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_SchemaResult},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_SchemaResult},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_SchemaResult},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_12SchemaResult_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_SchemaResult},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_SchemaResult_spec = {
  "pyarrow._flight.SchemaResult",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_SchemaResult),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_SchemaResult_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_SchemaResult = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""SchemaResult", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_SchemaResult), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_SchemaResult, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_12SchemaResult_9__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("SchemaResult(Schema schema)\n\nThe serialized schema returned from a GetSchema request."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_SchemaResult, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_SchemaResult, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_SchemaResult, /*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_7pyarrow_7_flight_12SchemaResult_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_SchemaResult, /*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 !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_7pyarrow_7_flight_FlightInfo __pyx_vtable_7pyarrow_7_flight_FlightInfo;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightInfo;
  __Pyx_default_placement_construct(&(p->info));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightInfo(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightInfo *p = (struct __pyx_obj_7pyarrow_7_flight_FlightInfo *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightInfo) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->info);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightInfo);
}

static PyObject *__pyx_tp_richcompare_7pyarrow_7_flight_FlightInfo(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_7pyarrow_7_flight_10FlightInfo_7__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_7_flight_10FlightInfo_7__eq__(o1, o2);
      if (likely(ret && ret != Py_NotImplemented)) {
        int b = __Pyx_PyObject_IsTrue(ret);
        Py_DECREF(ret);
        if (unlikely(b < 0)) return NULL;
        ret = (b) ? Py_False : Py_True;
        Py_INCREF(ret);
      }
      return ret;
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_total_records(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_13total_records_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_total_bytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_11total_bytes_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_ordered(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_7ordered_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_app_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_12app_metadata_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_descriptor(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_10descriptor_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_10FlightInfo_endpoints(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_10FlightInfo_9endpoints_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightInfo[] = {
  {"serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_3serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_2serialize},
  {"deserialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_5deserialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_4deserialize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_10FlightInfo_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightInfo[] = {
  {"total_records", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_total_records, 0, PyDoc_STR("The total record count of this flight, or -1 if unknown."), 0},
  {"total_bytes", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_total_bytes, 0, PyDoc_STR("The size in bytes of the data in this flight, or -1 if unknown."), 0},
  {"ordered", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_ordered, 0, PyDoc_STR("Whether endpoints are in the same order as the data."), 0},
  {"app_metadata", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_app_metadata, 0, PyDoc_STR("\n        Application-defined opaque metadata.\n\n        There is no inherent or required relationship between this and the\n        app_metadata fields in the FlightEndpoints or resulting FlightData\n        messages. Since this metadata is application-defined, a given\n        application could define there to be a relationship, but there is\n        none required by the spec.\n\n        "), 0},
  {"schema", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_schema, 0, PyDoc_STR("The schema of the data in this flight."), 0},
  {"descriptor", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_descriptor, 0, PyDoc_STR("The descriptor of the data in this flight."), 0},
  {"endpoints", __pyx_getprop_7pyarrow_7_flight_10FlightInfo_endpoints, 0, PyDoc_STR("The endpoints where this flight is available."), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightInfo_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightInfo},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_10FlightInfo_9__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("FlightInfo(Schema schema, FlightDescriptor descriptor, endpoints, total_records=None, total_bytes=None, ordered=False, app_metadata='')\n\nA description of a Flight stream.")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_7pyarrow_7_flight_FlightInfo},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightInfo},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightInfo},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_10FlightInfo_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightInfo},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightInfo_spec = {
  "pyarrow._flight.FlightInfo",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightInfo),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightInfo_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightInfo = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightInfo", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightInfo), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightInfo, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_10FlightInfo_9__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("FlightInfo(Schema schema, FlightDescriptor descriptor, endpoints, total_records=None, total_bytes=None, ordered=False, app_metadata='')\n\nA description of a Flight stream."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_tp_richcompare_7pyarrow_7_flight_FlightInfo, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightInfo, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightInfo, /*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_7pyarrow_7_flight_10FlightInfo_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightInfo, /*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 !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_7pyarrow_7_flight_FlightStreamChunk(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)o);
  __Pyx_default_placement_construct(&(p->chunk));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightStreamChunk(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *p = (struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightStreamChunk) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->chunk);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightStreamChunk);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightStreamChunk_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_4data_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_17FlightStreamChunk_app_metadata(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_12app_metadata_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightStreamChunk[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17FlightStreamChunk_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightStreamChunk[] = {
  {"data", __pyx_getprop_7pyarrow_7_flight_17FlightStreamChunk_data, 0, 0, 0},
  {"app_metadata", __pyx_getprop_7pyarrow_7_flight_17FlightStreamChunk_app_metadata, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightStreamChunk_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightStreamChunk},
  {Py_tp_repr, (void *)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_3__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("A RecordBatch with application metadata on the side.")},
  {Py_tp_iter, (void *)__pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_1__iter__},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightStreamChunk},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightStreamChunk},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightStreamChunk},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightStreamChunk_spec = {
  "pyarrow._flight.FlightStreamChunk",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightStreamChunk_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightStreamChunk = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightStreamChunk", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightStreamChunk, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_3__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("A RecordBatch with application metadata on the side."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_7_flight_17FlightStreamChunk_1__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightStreamChunk, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightStreamChunk, /*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_7pyarrow_7_flight_FlightStreamChunk, /*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 !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_7pyarrow_7_flight__MetadataRecordBatchReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)o);
  __Pyx_default_placement_construct(&(p->reader));
  p->__dict__ = PyDict_New(); if (unlikely(!p->__dict__)) goto bad;return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *p = (struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  if (p->__dict__) PyDict_Clear(p->__dict__);
  __Pyx_call_destructor(p->reader);
  Py_CLEAR(p->__dict__);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader);
}

static int __pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *p = (struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->__dict__) {
    e = (*v)(p->__dict__, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *p = (struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader); }
  tmp = ((PyObject*)p->__dict__);
  p->__dict__ = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight__MetadataRecordBatchReader(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *p = (struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader *)o;
  if (unlikely(!p->__dict__)){
    p->__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__dict__);
  return p->__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight__MetadataRecordBatchReader PyObject_GenericGetDict
#endif

static PyObject *__pyx_getprop_7pyarrow_7_flight_26_MetadataRecordBatchReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_6schema_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_26_MetadataRecordBatchReader_stats(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5stats_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight__MetadataRecordBatchReader[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {"read_all", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_4read_all},
  {"read_chunk", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_6read_chunk},
  {"to_reader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_8to_reader},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_26_MetadataRecordBatchReader_12__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight__MetadataRecordBatchReader[] = {
  {"schema", __pyx_getprop_7pyarrow_7_flight_26_MetadataRecordBatchReader_schema, 0, PyDoc_STR("Get the schema for this reader."), 0},
  {"stats", __pyx_getprop_7pyarrow_7_flight_26_MetadataRecordBatchReader_stats, 0, PyDoc_STR("\n        Current Flight read statistics.\n\n        Returns\n        -------\n        ReadStats\n        "), 0},
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight__MetadataRecordBatchReader, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members__MetadataRecordBatchReader[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader, __dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_doc, (void *)PyDoc_STR("A reader for Flight streams.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_iter, (void *)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_1__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_members, (void *)__pyx_tp_members__MetadataRecordBatchReader},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight__MetadataRecordBatchReader},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader, __dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader_spec = {
  "pyarrow._flight._MetadataRecordBatchReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader),
  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_7pyarrow_7_flight__MetadataRecordBatchReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""_MetadataRecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("A reader for Flight streams."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_1__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader, __dict__), /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader, /*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 !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_MetadataRecordBatchReader(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *p = (struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader *)o;
  if (unlikely(!p->__pyx_base.__dict__)){
    p->__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__dict__);
  return p->__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_MetadataRecordBatchReader PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_MetadataRecordBatchReader[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchReader_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchReader_2__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_MetadataRecordBatchReader[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_MetadataRecordBatchReader, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_MetadataRecordBatchReader[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_doc, (void *)PyDoc_STR("The base class for readers for Flight streams.\n\n    See Also\n    --------\n    FlightStreamReader\n    ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_MetadataRecordBatchReader},
  {Py_tp_members, (void *)__pyx_tp_members_MetadataRecordBatchReader},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_MetadataRecordBatchReader},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader_spec = {
  "pyarrow._flight.MetadataRecordBatchReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader),
  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_7pyarrow_7_flight_MetadataRecordBatchReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""MetadataRecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("The base class for readers for Flight streams.\n\n    See Also\n    --------\n    FlightStreamReader\n    "), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_1__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_7_flight_MetadataRecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_MetadataRecordBatchReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader, /*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 !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__pyx___dict__getter_7pyarrow_7_flight_FlightStreamReader(PyObject *o, CYTHON_UNUSED void *x) {
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *p = (struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader *)o;
  if (unlikely(!p->__pyx_base.__pyx_base.__dict__)){
    p->__pyx_base.__pyx_base.__dict__ = PyDict_New();
  }
  Py_XINCREF(p->__pyx_base.__pyx_base.__dict__);
  return p->__pyx_base.__pyx_base.__dict__;
}
#else
#define __pyx___dict__getter_7pyarrow_7_flight_FlightStreamReader PyObject_GenericGetDict
#endif

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightStreamReader[] = {
  {"cancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_1cancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_cancel},
  {"read_all", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_3read_all, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_2read_all},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamReader_6__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightStreamReader[] = {
  {"__dict__", __pyx___dict__getter_7pyarrow_7_flight_FlightStreamReader, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static struct PyMemberDef __pyx_tp_members_FlightStreamReader[] = {
  {"__dictoffset__", T_PYSSIZET, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader, __pyx_base.__pyx_base.__dict__), READONLY, NULL},
  {NULL, 0, 0, 0, NULL}
};
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightStreamReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_doc, (void *)PyDoc_STR("A reader that can also be canceled.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightStreamReader},
  {Py_tp_members, (void *)__pyx_tp_members_FlightStreamReader},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightStreamReader},
  #if !CYTHON_USE_TYPE_SPECS
  {Py_tp_dictoffset, (void *)offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader, __pyx_base.__pyx_base.__dict__)},
  #endif
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightStreamReader_spec = {
  "pyarrow._flight.FlightStreamReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader),
  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_7pyarrow_7_flight_FlightStreamReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightStreamReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightStreamReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("A reader that can also be canceled."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight__MetadataRecordBatchReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_1__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_7pyarrow_7_flight_26_MetadataRecordBatchReader_3__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  __pyx_methods_7pyarrow_7_flight_FlightStreamReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightStreamReader, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader, __pyx_base.__pyx_base.__dict__), /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight__MetadataRecordBatchReader, /*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 !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_7pyarrow_7_flight_MetadataRecordBatchWriter __pyx_vtable_7pyarrow_7_flight_MetadataRecordBatchWriter;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_MetadataRecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_MetadataRecordBatchWriter;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_MetadataRecordBatchWriter) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_MetadataRecordBatchWriter[] = {
  {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_begin},
  {"write_metadata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_2write_metadata},
  {"write_batch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_4write_batch},
  {"write_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_6write_table},
  {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_8close},
  {"write_with_metadata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_10write_with_metadata},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_25MetadataRecordBatchWriter_14__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter},
  {Py_tp_doc, (void *)PyDoc_STR("A RecordBatchWriter that also allows writing application metadata.\n\n    This class is a context manager; on exit, close() will be called.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_MetadataRecordBatchWriter},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_MetadataRecordBatchWriter},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter_spec = {
  "pyarrow._flight.MetadataRecordBatchWriter",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""MetadataRecordBatchWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A RecordBatchWriter that also allows writing application metadata.\n\n    This class is a context manager; on exit, close() will be called.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_MetadataRecordBatchWriter, /*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_7pyarrow_7_flight_MetadataRecordBatchWriter, /*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 !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_7pyarrow_7_flight_FlightStreamWriter __pyx_vtable_7pyarrow_7_flight_FlightStreamWriter;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightStreamWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_MetadataRecordBatchWriter(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_MetadataRecordBatchWriter*)__pyx_vtabptr_7pyarrow_7_flight_FlightStreamWriter;
  return o;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightStreamWriter[] = {
  {"done_writing", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_1done_writing, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_done_writing},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_18FlightStreamWriter_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightStreamWriter_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter},
  {Py_tp_doc, (void *)PyDoc_STR("A writer that also allows closing the write side of a stream.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightStreamWriter},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightStreamWriter},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightStreamWriter_spec = {
  "pyarrow._flight.FlightStreamWriter",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightStreamWriter_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightStreamWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightStreamWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_MetadataRecordBatchWriter, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A writer that also allows closing the write side of a stream."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightStreamWriter, /*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_7pyarrow_7_flight_FlightStreamWriter, /*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 !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_7pyarrow_7_flight_FlightMetadataReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)o);
  __Pyx_default_placement_construct(&(p->reader));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *p = (struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightMetadataReader) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->reader);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataReader);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightMetadataReader[] = {
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_read},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataReader_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightMetadataReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataReader},
  {Py_tp_doc, (void *)PyDoc_STR("A reader for Flight metadata messages sent during a DoPut.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightMetadataReader},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightMetadataReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightMetadataReader_spec = {
  "pyarrow._flight.FlightMetadataReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightMetadataReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightMetadataReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightMetadataReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A reader for Flight metadata messages sent during a DoPut."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightMetadataReader, /*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_7pyarrow_7_flight_FlightMetadataReader, /*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 !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_7pyarrow_7_flight_FlightMetadataWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)o);
  __Pyx_default_placement_construct(&(p->writer));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *p = (struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightMetadataWriter) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->writer);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataWriter);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightMetadataWriter[] = {
  {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_write},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_20FlightMetadataWriter_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightMetadataWriter_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataWriter},
  {Py_tp_doc, (void *)PyDoc_STR("A sender for Flight metadata messages during a DoPut.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightMetadataWriter},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightMetadataWriter},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightMetadataWriter_spec = {
  "pyarrow._flight.FlightMetadataWriter",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightMetadataWriter_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightMetadataWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightMetadataWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightMetadataWriter, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A sender for Flight metadata messages during a DoPut."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightMetadataWriter, /*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_7pyarrow_7_flight_FlightMetadataWriter, /*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 !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_7pyarrow_7_flight_AsyncioFlightClient __pyx_vtable_7pyarrow_7_flight_AsyncioFlightClient;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_AsyncioFlightClient(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_AsyncioFlightClient;
  p->_client = ((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_AsyncioFlightClient(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *p = (struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight_AsyncioFlightClient) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_client);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_7pyarrow_7_flight_AsyncioFlightClient(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *p = (struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_client) {
    e = (*v)(((PyObject *)p->_client), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight_AsyncioFlightClient(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *p = (struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *)o;
  tmp = ((PyObject*)p->_client);
  p->_client = ((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_AsyncioFlightClient[] = {
  {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_2get_flight_info},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_6__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_5__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_19AsyncioFlightClient_7__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_AsyncioFlightClient_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_AsyncioFlightClient},
  {Py_tp_doc, (void *)PyDoc_STR("AsyncioFlightClient(FlightClient client) -> None\n\nA FlightClient with an asyncio-based async interface.\n\nThis interface is EXPERIMENTAL.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_AsyncioFlightClient},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_AsyncioFlightClient},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_AsyncioFlightClient},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_19AsyncioFlightClient_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_AsyncioFlightClient},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_AsyncioFlightClient_spec = {
  "pyarrow._flight.AsyncioFlightClient",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient),
  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_7pyarrow_7_flight_AsyncioFlightClient_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_AsyncioFlightClient = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""AsyncioFlightClient", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_AsyncioFlightClient, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("AsyncioFlightClient(FlightClient client) -> None\n\nA FlightClient with an asyncio-based async interface.\n\nThis interface is EXPERIMENTAL."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_AsyncioFlightClient, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_AsyncioFlightClient, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_AsyncioFlightClient, /*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_7pyarrow_7_flight_19AsyncioFlightClient_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_AsyncioFlightClient, /*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 !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_7pyarrow_7_flight_FlightClient __pyx_vtable_7pyarrow_7_flight_FlightClient;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightClient(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightClient *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightClient *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightClient;
  __Pyx_default_placement_construct(&(p->client));
  return o;
}

#if CYTHON_USE_TP_FINALIZE

static void __pyx_tp_finalize_7pyarrow_7_flight_FlightClient(PyObject *o) {
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  __pyx_pw_7pyarrow_7_flight_12FlightClient_32__del__(o);
  PyErr_Restore(etype, eval, etb);
}
#endif

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightClient(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightClient *p = (struct __pyx_obj_7pyarrow_7_flight_FlightClient *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightClient) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->client);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightClient);
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_12FlightClient_supports_async(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_12FlightClient_14supports_async_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightClient[] = {
  {"as_async", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_3as_async, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_2as_async},
  {"wait_for_available", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_5wait_for_available, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_4wait_for_available},
  {"connect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_7connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_6connect},
  {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_9authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_8authenticate},
  {"authenticate_basic_token", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_10authenticate_basic_token},
  {"list_actions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_13list_actions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_12list_actions},
  {"do_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_15do_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_14do_action},
  {"list_flights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_17list_flights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_16list_flights},
  {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_20get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_19get_flight_info},
  {"get_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_22get_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_21get_schema},
  {"do_get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_24do_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_23do_get},
  {"do_put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_26do_put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_25do_put},
  {"do_exchange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_28do_exchange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_27do_exchange},
  {"close", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_30close, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_29close},
  {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_34__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_33__enter__},
  {"__exit__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_36__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_35__exit__},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_38__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_37__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_12FlightClient_40__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_12FlightClient_39__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightClient[] = {
  {"supports_async", __pyx_getprop_7pyarrow_7_flight_12FlightClient_supports_async, 0, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightClient_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightClient},
  {Py_tp_doc, (void *)PyDoc_STR("FlightClient(location, tls_root_certs=None, *, cert_chain=None, private_key=None, override_hostname=None, middleware=None, write_size_limit_bytes=None, disable_server_verification=None, generic_options=None)\n\nA client to a Flight service.\n\nConnect to a Flight service on the given host and port.\n\nParameters\n----------\nlocation : str, tuple or Location\n    Location to connect to. Either a gRPC URI like `grpc://localhost:port`,\n    a tuple of (host, port) pair, or a Location instance.\ntls_root_certs : bytes or None\n    PEM-encoded\ncert_chain: bytes or None\n    Client certificate if using mutual TLS\nprivate_key: bytes or None\n    Client private key for cert_chain is using mutual TLS\noverride_hostname : str or None\n    Override the hostname checked by TLS. Insecure, use with caution.\nmiddleware : list optional, default None\n    A list of ClientMiddlewareFactory instances.\nwrite_size_limit_bytes : int optional, default None\n    A soft limit on the size of a data payload sent to the\n    server. Enabled if positive. If enabled, writing a record\n    batch that (when serialized) exceeds this limit will raise an\n    exception; the client can retry the write with a smaller\n    batch.\ndisable_server_verification : boolean optional, default False\n    A flag that indicates that, if the client is connecting\n    with TLS, that it skips server verification. If this is\n    enabled, all other TLS settings are overridden.\ngeneric_options : list optional, default None\n    A list of generic (string, int or string) option tuples passed\n    to the underlying transport. Effect is implementation\n    dependent.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightClient},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightClient},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_12FlightClient_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightClient},
  #if CYTHON_USE_TP_FINALIZE
  {Py_tp_finalize, (void *)__pyx_tp_finalize_7pyarrow_7_flight_FlightClient},
  #endif
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightClient_spec = {
  "pyarrow._flight.FlightClient",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightClient),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightClient_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightClient = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightClient", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightClient), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightClient, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("FlightClient(location, tls_root_certs=None, *, cert_chain=None, private_key=None, override_hostname=None, middleware=None, write_size_limit_bytes=None, disable_server_verification=None, generic_options=None)\n\nA client to a Flight service.\n\nConnect to a Flight service on the given host and port.\n\nParameters\n----------\nlocation : str, tuple or Location\n    Location to connect to. Either a gRPC URI like `grpc://localhost:port`,\n    a tuple of (host, port) pair, or a Location instance.\ntls_root_certs : bytes or None\n    PEM-encoded\ncert_chain: bytes or None\n    Client certificate if using mutual TLS\nprivate_key: bytes or None\n    Client private key for cert_chain is using mutual TLS\noverride_hostname : str or None\n    Override the hostname checked by TLS. Insecure, use with caution.\nmiddleware : list optional, default None\n    A list of ClientMiddlewareFactory instances.\nwrite_size_limit_bytes : int optional, default None\n    A soft limit on the size of a data payload sent to the\n    server. Enabled if positive. If enabled, writing a record\n    batch that (when serialized) exceeds this limit will raise an\n    exception; the client can retry the write with a smaller\n    batch.\ndisable_server_verification : boolean optional, default False\n    A flag that indicates that, if the client is connecting\n    with TLS, that it skips server verification. If this is\n    enabled, all other TLS settings are overridden.\ngeneric_options : list optional, default None\n    A list of generic (string, int or string) option tuples passed\n    to the underlying transport. Effect is implementation\n    dependent."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightClient, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightClient, /*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_7pyarrow_7_flight_12FlightClient_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightClient, /*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
  __pyx_tp_finalize_7pyarrow_7_flight_FlightClient, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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_7pyarrow_7_flight_FlightDataStream __pyx_vtable_7pyarrow_7_flight_FlightDataStream;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightDataStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightDataStream;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_FlightDataStream) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightDataStream[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDataStream_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDataStream___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightDataStream_2__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightDataStream_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream},
  {Py_tp_doc, (void *)PyDoc_STR("\n    Abstract base class for Flight data streams.\n\n    See Also\n    --------\n    RecordBatchStream\n    GeneratorStream\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightDataStream},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightDataStream},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightDataStream_spec = {
  "pyarrow._flight.FlightDataStream",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_FlightDataStream_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightDataStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightDataStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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    Abstract base class for Flight data streams.\n\n    See Also\n    --------\n    RecordBatchStream\n    GeneratorStream\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightDataStream, /*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_7pyarrow_7_flight_FlightDataStream, /*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 !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_7pyarrow_7_flight_RecordBatchStream __pyx_vtable_7pyarrow_7_flight_RecordBatchStream;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_RecordBatchStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightDataStream(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream*)__pyx_vtabptr_7pyarrow_7_flight_RecordBatchStream;
  __Pyx_default_placement_construct(&(p->write_options));
  p->data_source = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_RecordBatchStream(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *p = (struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight_RecordBatchStream) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->write_options);
  Py_CLEAR(p->data_source);
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream(o);
}

static int __pyx_tp_traverse_7pyarrow_7_flight_RecordBatchStream(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *p = (struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight_RecordBatchStream); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->data_source) {
    e = (*v)(p->data_source, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight_RecordBatchStream(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *p = (struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight_RecordBatchStream); }
  tmp = ((PyObject*)p->data_source);
  p->data_source = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_RecordBatchStream[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17RecordBatchStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17RecordBatchStream_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_RecordBatchStream_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_RecordBatchStream},
  {Py_tp_doc, (void *)PyDoc_STR("RecordBatchStream(data_source, options=None)\n\nA Flight data stream backed by RecordBatches.\n\nThe remainder of this DoGet request will be handled in C++,\nwithout having to acquire the GIL.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_RecordBatchStream},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_RecordBatchStream},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_RecordBatchStream},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_17RecordBatchStream_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_RecordBatchStream},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_RecordBatchStream_spec = {
  "pyarrow._flight.RecordBatchStream",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream),
  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_7pyarrow_7_flight_RecordBatchStream_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_RecordBatchStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""RecordBatchStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_RecordBatchStream, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("RecordBatchStream(data_source, options=None)\n\nA Flight data stream backed by RecordBatches.\n\nThe remainder of this DoGet request will be handled in C++,\nwithout having to acquire the GIL."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_RecordBatchStream, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_RecordBatchStream, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_RecordBatchStream, /*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_7pyarrow_7_flight_17RecordBatchStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_RecordBatchStream, /*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 !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_7pyarrow_7_flight_GeneratorStream __pyx_vtable_7pyarrow_7_flight_GeneratorStream;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_GeneratorStream(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_FlightDataStream(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_FlightDataStream*)__pyx_vtabptr_7pyarrow_7_flight_GeneratorStream;
  __Pyx_default_placement_construct(&(p->schema));
  __Pyx_default_placement_construct(&(p->current_stream));
  __Pyx_default_placement_construct(&(p->c_options));
  p->generator = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_GeneratorStream(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *p = (struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight_GeneratorStream) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->schema);
  __Pyx_call_destructor(p->current_stream);
  __Pyx_call_destructor(p->c_options);
  Py_CLEAR(p->generator);
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightDataStream(o);
}

static int __pyx_tp_traverse_7pyarrow_7_flight_GeneratorStream(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *p = (struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight_GeneratorStream); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->generator) {
    e = (*v)(p->generator, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight_GeneratorStream(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *p = (struct __pyx_obj_7pyarrow_7_flight_GeneratorStream *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight_GeneratorStream); }
  tmp = ((PyObject*)p->generator);
  p->generator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_GeneratorStream[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_15GeneratorStream_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_15GeneratorStream_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_GeneratorStream_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_GeneratorStream},
  {Py_tp_doc, (void *)PyDoc_STR("GeneratorStream(schema, generator, options=None)\n\nA Flight data stream backed by a Python generator.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_GeneratorStream},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_GeneratorStream},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_GeneratorStream},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_15GeneratorStream_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_GeneratorStream},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_GeneratorStream_spec = {
  "pyarrow._flight.GeneratorStream",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream),
  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_7pyarrow_7_flight_GeneratorStream_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_GeneratorStream = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""GeneratorStream", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_GeneratorStream, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("GeneratorStream(schema, generator, options=None)\n\nA Flight data stream backed by a Python generator."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_GeneratorStream, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_GeneratorStream, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_GeneratorStream, /*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_7pyarrow_7_flight_15GeneratorStream_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_GeneratorStream, /*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 !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_7pyarrow_7_flight_ServerCallContext __pyx_vtable_7pyarrow_7_flight_ServerCallContext;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerCallContext(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ServerCallContext;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerCallContext(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerCallContext) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerCallContext);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerCallContext[] = {
  {"peer_identity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_1peer_identity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_peer_identity},
  {"peer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_3peer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_2peer},
  {"is_cancelled", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_5is_cancelled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_4is_cancelled},
  {"add_header", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_7add_header, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_6add_header},
  {"add_trailer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_9add_trailer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_8add_trailer},
  {"get_middleware", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_11get_middleware, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_10get_middleware},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_12__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerCallContext_14__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerCallContext_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerCallContext},
  {Py_tp_doc, (void *)PyDoc_STR("Per-call state/context.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerCallContext},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerCallContext},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerCallContext_spec = {
  "pyarrow._flight.ServerCallContext",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerCallContext_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerCallContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerCallContext", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerCallContext, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("Per-call state/context."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerCallContext, /*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_7pyarrow_7_flight_ServerCallContext, /*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 !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_7pyarrow_7_flight_ServerAuthReader __pyx_vtable_7pyarrow_7_flight_ServerAuthReader;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ServerAuthReader;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthReader(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerAuthReader) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthReader);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerAuthReader[] = {
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_read},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthReader_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerAuthReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthReader},
  {Py_tp_doc, (void *)PyDoc_STR("A reader for messages from the client during an auth handshake.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerAuthReader},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerAuthReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerAuthReader_spec = {
  "pyarrow._flight.ServerAuthReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerAuthReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerAuthReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerAuthReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A reader for messages from the client during an auth handshake."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerAuthReader, /*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_7pyarrow_7_flight_ServerAuthReader, /*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 !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_7pyarrow_7_flight_ServerAuthSender __pyx_vtable_7pyarrow_7_flight_ServerAuthSender;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthSender(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ServerAuthSender;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthSender(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerAuthSender) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthSender);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerAuthSender[] = {
  {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_write},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerAuthSender_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerAuthSender_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthSender},
  {Py_tp_doc, (void *)PyDoc_STR("A writer for messages to the client during an auth handshake.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerAuthSender},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerAuthSender},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerAuthSender_spec = {
  "pyarrow._flight.ServerAuthSender",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerAuthSender_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerAuthSender = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerAuthSender", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthSender, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A writer for messages to the client during an auth handshake."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerAuthSender, /*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_7pyarrow_7_flight_ServerAuthSender, /*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 !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_7pyarrow_7_flight_ClientAuthReader __pyx_vtable_7pyarrow_7_flight_ClientAuthReader;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ClientAuthReader;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthReader(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ClientAuthReader) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthReader);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ClientAuthReader[] = {
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_1read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_read},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthReader_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ClientAuthReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthReader},
  {Py_tp_doc, (void *)PyDoc_STR("A reader for messages from the server during an auth handshake.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ClientAuthReader},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ClientAuthReader},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ClientAuthReader_spec = {
  "pyarrow._flight.ClientAuthReader",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ClientAuthReader_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ClientAuthReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ClientAuthReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthReader, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A reader for messages from the server during an auth handshake."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ClientAuthReader, /*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_7pyarrow_7_flight_ClientAuthReader, /*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 !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_7pyarrow_7_flight_ClientAuthSender __pyx_vtable_7pyarrow_7_flight_ClientAuthSender;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthSender(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ClientAuthSender;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthSender(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ClientAuthSender) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthSender);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ClientAuthSender[] = {
  {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_1write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_write},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientAuthSender_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ClientAuthSender_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthSender},
  {Py_tp_doc, (void *)PyDoc_STR("A writer for messages to the server during an auth handshake.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ClientAuthSender},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ClientAuthSender},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ClientAuthSender_spec = {
  "pyarrow._flight.ClientAuthSender",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ClientAuthSender_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ClientAuthSender = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ClientAuthSender", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthSender, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A writer for messages to the server during an auth handshake."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ClientAuthSender, /*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_7pyarrow_7_flight_ClientAuthSender, /*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 !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_7pyarrow_7_flight_ServerAuthHandler __pyx_vtable_7pyarrow_7_flight_ServerAuthHandler;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerAuthHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ServerAuthHandler;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthHandler(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerAuthHandler) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthHandler);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerAuthHandler[] = {
  {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_1authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_authenticate},
  {"is_valid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_3is_valid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_2is_valid},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ServerAuthHandler_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerAuthHandler_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthHandler},
  {Py_tp_doc, (void *)PyDoc_STR("Authentication middleware for a server.\n\n    To implement an authentication mechanism, subclass this class and\n    override its methods.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerAuthHandler},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerAuthHandler},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerAuthHandler_spec = {
  "pyarrow._flight.ServerAuthHandler",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerAuthHandler_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerAuthHandler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerAuthHandler", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerAuthHandler, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("Authentication middleware for a server.\n\n    To implement an authentication mechanism, subclass this class and\n    override its methods.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerAuthHandler, /*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_7pyarrow_7_flight_ServerAuthHandler, /*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 !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_7pyarrow_7_flight_ClientAuthHandler __pyx_vtable_7pyarrow_7_flight_ClientAuthHandler;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientAuthHandler(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ClientAuthHandler;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthHandler(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ClientAuthHandler) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthHandler);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ClientAuthHandler[] = {
  {"authenticate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_1authenticate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_authenticate},
  {"get_token", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_3get_token, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_2get_token},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_17ClientAuthHandler_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ClientAuthHandler_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthHandler},
  {Py_tp_doc, (void *)PyDoc_STR("Authentication plugin for a client.")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ClientAuthHandler},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ClientAuthHandler},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ClientAuthHandler_spec = {
  "pyarrow._flight.ClientAuthHandler",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ClientAuthHandler_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ClientAuthHandler = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ClientAuthHandler", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ClientAuthHandler, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("Authentication plugin for a client."), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ClientAuthHandler, /*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_7pyarrow_7_flight_ClientAuthHandler, /*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 !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_7pyarrow_7_flight_ClientMiddlewareFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddlewareFactory(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ClientMiddlewareFactory) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddlewareFactory);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ClientMiddlewareFactory[] = {
  {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_start_call},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ClientMiddlewareFactory_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddlewareFactory},
  {Py_tp_doc, (void *)PyDoc_STR("A factory for new middleware instances.\n\n    All middleware methods will be called from the same thread as the\n    RPC method implementation. That is, thread-locals set in the\n    client are accessible from the middleware itself.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ClientMiddlewareFactory},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ClientMiddlewareFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory_spec = {
  "pyarrow._flight.ClientMiddlewareFactory",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ClientMiddlewareFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddlewareFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A factory for new middleware instances.\n\n    All middleware methods will be called from the same thread as the\n    RPC method implementation. That is, thread-locals set in the\n    client are accessible from the middleware itself.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ClientMiddlewareFactory, /*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_7pyarrow_7_flight_ClientMiddlewareFactory, /*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 !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_7pyarrow_7_flight_ClientMiddleware __pyx_vtable_7pyarrow_7_flight_ClientMiddleware;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ClientMiddleware(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ClientMiddleware;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddleware(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ClientMiddleware) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddleware);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ClientMiddleware[] = {
  {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_1sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_sending_headers},
  {"received_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_3received_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_2received_headers},
  {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_5call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_4call_completed},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ClientMiddleware_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ClientMiddleware_8__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ClientMiddleware_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddleware},
  {Py_tp_doc, (void *)PyDoc_STR("Client-side middleware for a call, instantiated per RPC.\n\n    Methods here should be fast and must be infallible: they should\n    not raise exceptions or stall indefinitely.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ClientMiddleware},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ClientMiddleware},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ClientMiddleware_spec = {
  "pyarrow._flight.ClientMiddleware",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ClientMiddleware_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ClientMiddleware = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ClientMiddleware", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ClientMiddleware, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("Client-side middleware for a call, instantiated per RPC.\n\n    Methods here should be fast and must be infallible: they should\n    not raise exceptions or stall indefinitely.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ClientMiddleware, /*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_7pyarrow_7_flight_ClientMiddleware, /*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 !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_7pyarrow_7_flight_ServerMiddlewareFactory(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerMiddlewareFactory) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerMiddlewareFactory[] = {
  {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_start_call},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_23ServerMiddlewareFactory_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory},
  {Py_tp_doc, (void *)PyDoc_STR("A factory for new middleware instances.\n\n    All middleware methods will be called from the same thread as the\n    RPC method implementation. That is, thread-locals set in the\n    middleware are accessible from the method itself.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerMiddlewareFactory},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerMiddlewareFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory_spec = {
  "pyarrow._flight.ServerMiddlewareFactory",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerMiddlewareFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A factory for new middleware instances.\n\n    All middleware methods will be called from the same thread as the\n    RPC method implementation. That is, thread-locals set in the\n    middleware are accessible from the method itself.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerMiddlewareFactory, /*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_7pyarrow_7_flight_ServerMiddlewareFactory, /*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 !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_7pyarrow_7_flight_TracingServerMiddlewareFactory[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_30TracingServerMiddlewareFactory_2__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory},
  {Py_tp_doc, (void *)PyDoc_STR("A factory for tracing middleware instances.\n\n    This enables OpenTelemetry support in Arrow (if Arrow was compiled\n    with OpenTelemetry support enabled). A new span will be started on\n    each RPC call. The TracingServerMiddleware instance can then be\n    retrieved within an RPC handler to get the propagated context,\n    which can be used to start a new span on the Python side.\n\n    Because the Python/C++ OpenTelemetry libraries do not\n    interoperate, spans on the C++ side are not directly visible to\n    the Python side and vice versa.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_TracingServerMiddlewareFactory},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerMiddlewareFactory},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory_spec = {
  "pyarrow._flight.TracingServerMiddlewareFactory",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""TracingServerMiddlewareFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("A factory for tracing middleware instances.\n\n    This enables OpenTelemetry support in Arrow (if Arrow was compiled\n    with OpenTelemetry support enabled). A new span will be started on\n    each RPC call. The TracingServerMiddleware instance can then be\n    retrieved within an RPC handler to get the propagated context,\n    which can be used to start a new span on the Python side.\n\n    Because the Python/C++ OpenTelemetry libraries do not\n    interoperate, spans on the C++ side are not directly visible to\n    the Python side and vice versa.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_TracingServerMiddlewareFactory, /*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_7pyarrow_7_flight_ServerMiddlewareFactory, /*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 !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_7pyarrow_7_flight_ServerMiddleware __pyx_vtable_7pyarrow_7_flight_ServerMiddleware;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_ServerMiddleware(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_ServerMiddleware;
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddleware(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight_ServerMiddleware) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddleware);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_ServerMiddleware[] = {
  {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_1sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_sending_headers},
  {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_3call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_2call_completed},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16ServerMiddleware_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_ServerMiddleware_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddleware},
  {Py_tp_doc, (void *)PyDoc_STR("Server-side middleware for a call, instantiated per RPC.\n\n    Methods here should be fast and must be infallible: they should\n    not raise exceptions or stall indefinitely.\n\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_ServerMiddleware},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_ServerMiddleware},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_ServerMiddleware_spec = {
  "pyarrow._flight.ServerMiddleware",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight_ServerMiddleware_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_ServerMiddleware = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""ServerMiddleware", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddleware, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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("Server-side middleware for a call, instantiated per RPC.\n\n    Methods here should be fast and must be infallible: they should\n    not raise exceptions or stall indefinitely.\n\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_ServerMiddleware, /*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_7pyarrow_7_flight_ServerMiddleware, /*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 !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_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_ServerMiddlewareFactory(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)o);
  p->factories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->factories);
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddlewareFactory(o);
}

static int __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->factories) {
    e = (*v)(p->factories, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper); }
  tmp = ((PyObject*)p->factories);
  p->factories = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper[] = {
  {"start_call", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_2start_call},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_6__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper},
  {Py_tp_doc, (void *)PyDoc_STR("_ServerMiddlewareFactoryWrapper(dict factories)\n\nWrapper to bundle server middleware into a single C++ one.")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper_spec = {
  "pyarrow._flight._ServerMiddlewareFactoryWrapper",
  sizeof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper),
  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_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""_ServerMiddlewareFactoryWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("_ServerMiddlewareFactoryWrapper(dict factories)\n\nWrapper to bundle server middleware into a single C++ one."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, /*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_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, /*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 !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_7pyarrow_7_flight__ServerMiddlewareWrapper __pyx_vtable_7pyarrow_7_flight__ServerMiddlewareWrapper;

static PyObject *__pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *p;
  PyObject *o = __pyx_tp_new_7pyarrow_7_flight_ServerMiddleware(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7pyarrow_7_flight_ServerMiddleware*)__pyx_vtabptr_7pyarrow_7_flight__ServerMiddlewareWrapper;
  p->middleware = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareWrapper(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareWrapper) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->middleware);
  __pyx_tp_dealloc_7pyarrow_7_flight_ServerMiddleware(o);
}

static int __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareWrapper); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->middleware) {
    e = (*v)(p->middleware, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareWrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *p = (struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareWrapper); }
  tmp = ((PyObject*)p->middleware);
  p->middleware = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight__ServerMiddlewareWrapper[] = {
  {"sending_headers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_2sending_headers},
  {"call_completed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_4call_completed},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_24_ServerMiddlewareWrapper_8__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareWrapper},
  {Py_tp_doc, (void *)PyDoc_STR("_ServerMiddlewareWrapper(dict middleware)")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareWrapper},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareWrapper},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight__ServerMiddlewareWrapper},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_24_ServerMiddlewareWrapper_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareWrapper},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper_spec = {
  "pyarrow._flight._ServerMiddlewareWrapper",
  sizeof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper),
  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_7pyarrow_7_flight__ServerMiddlewareWrapper_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""_ServerMiddlewareWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__ServerMiddlewareWrapper, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("_ServerMiddlewareWrapper(dict middleware)"), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight__ServerMiddlewareWrapper, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight__ServerMiddlewareWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight__ServerMiddlewareWrapper, /*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_7pyarrow_7_flight_24_ServerMiddlewareWrapper_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight__ServerMiddlewareWrapper, /*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 !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_7pyarrow_7_flight__FlightServerFinalizer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)o);
  __Pyx_default_placement_construct(&(p->server));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight__FlightServerFinalizer(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *p = (struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight__FlightServerFinalizer) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->server);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight__FlightServerFinalizer);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight__FlightServerFinalizer[] = {
  {"finalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_finalize},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_22_FlightServerFinalizer_4__setstate_cython__},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight__FlightServerFinalizer_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight__FlightServerFinalizer},
  {Py_tp_doc, (void *)PyDoc_STR("\n    A finalizer that shuts down the server on destruction.\n\n    See ARROW-16597. If the server is still active at interpreter\n    exit, the process may segfault.\n    ")},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight__FlightServerFinalizer},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight__FlightServerFinalizer},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight__FlightServerFinalizer_spec = {
  "pyarrow._flight._FlightServerFinalizer",
  sizeof(struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_7pyarrow_7_flight__FlightServerFinalizer_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight__FlightServerFinalizer = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""_FlightServerFinalizer", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight__FlightServerFinalizer, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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    A finalizer that shuts down the server on destruction.\n\n    See ARROW-16597. If the server is still active at interpreter\n    exit, the process may segfault.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight__FlightServerFinalizer, /*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_7pyarrow_7_flight__FlightServerFinalizer, /*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 !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_7pyarrow_7_flight_FlightServerBase __pyx_vtable_7pyarrow_7_flight_FlightServerBase;

static PyObject *__pyx_tp_new_7pyarrow_7_flight_FlightServerBase(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_7_flight_FlightServerBase;
  __Pyx_default_placement_construct(&(p->server));
  p->finalizer = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight_FlightServerBase(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *p = (struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight_FlightServerBase) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->server);
  Py_CLEAR(p->finalizer);
  if (PyType_IS_GC(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) PyObject_GC_Track(o);
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_dealloc, destructor)(o); else
  #endif
  __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_7pyarrow_7_flight_FlightServerBase);
}

static int __pyx_tp_traverse_7pyarrow_7_flight_FlightServerBase(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *p = (struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)o;
  #if !CYTHON_USE_MODULE_STATE
  e = 0;
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    traverseproc traverse = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_traverse, traverseproc);
    if (traverse) { e = traverse(o, v, a); }
  } else
  #endif
  { e = __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7pyarrow_7_flight_FlightServerBase); }
  if (e) return e;
  {
    e = __Pyx_call_type_traverse(o, 0, v, a);
    if (e) return e;
  }
  if (p->finalizer) {
    e = (*v)(p->finalizer, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_7_flight_FlightServerBase(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *p = (struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *)o;
  #if !CYTHON_USE_MODULE_STATE
  if (likely(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable)) {
    inquiry clear = __Pyx_PyType_GetSlot(__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable, tp_clear, inquiry);
    if (clear) clear(o);
  } else
  #endif
  { __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7pyarrow_7_flight_FlightServerBase); }
  tmp = ((PyObject*)p->finalizer);
  p->finalizer = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7pyarrow_7_flight_16FlightServerBase_port(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_7_flight_16FlightServerBase_4port_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_7_flight_FlightServerBase[] = {
  {"list_flights", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_3list_flights, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_2list_flights},
  {"get_flight_info", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_5get_flight_info, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_4get_flight_info},
  {"get_schema", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_7get_schema, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_6get_schema},
  {"do_put", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_9do_put, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_8do_put},
  {"do_get", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_11do_get, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_10do_get},
  {"do_exchange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_13do_exchange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_12do_exchange},
  {"list_actions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_15list_actions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_14list_actions},
  {"do_action", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_17do_action, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_16do_action},
  {"serve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_19serve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_18serve},
  {"run", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_21run, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_20run},
  {"shutdown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_23shutdown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_22shutdown},
  {"wait", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_25wait, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_24wait},
  {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_27__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_26__enter__},
  {"__exit__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_29__exit__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_28__exit__},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_30__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7pyarrow_7_flight_16FlightServerBase_32__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_7_flight_FlightServerBase[] = {
  {"port", __pyx_getprop_7pyarrow_7_flight_16FlightServerBase_port, 0, PyDoc_STR("\n        Get the port that this server is listening on.\n\n        Returns a non-positive value if the operation is invalid\n        (e.g. init() was not called or server is listening on a domain\n        socket).\n        "), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight_FlightServerBase_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight_FlightServerBase},
  {Py_tp_doc, (void *)PyDoc_STR("FlightServerBase(location=None, auth_handler=None, tls_certificates=None, verify_client=None, root_certificates=None, middleware=None)\n\nA Flight service definition.\n\nTo start the server, create an instance of this class with an\nappropriate location. The server will be running as soon as the\ninstance is created; it is not required to call :meth:`serve`.\n\nOverride methods to define your Flight service.\n\nParameters\n----------\nlocation : str, tuple or Location optional, default None\n    Location to serve on. Either a gRPC URI like `grpc://localhost:port`,\n    a tuple of (host, port) pair, or a Location instance.\n    If None is passed then the server will be started on localhost with a\n    system provided random port.\nauth_handler : ServerAuthHandler optional, default None\n    An authentication mechanism to use. May be None.\ntls_certificates : list optional, default None\n    A list of (certificate, key) pairs.\nverify_client : boolean optional, default False\n    If True, then enable mutual TLS: require the client to present\n    a client certificate, and validate the certificate.\nroot_certificates : bytes optional, default None\n    If enabling mutual TLS, this specifies the PEM-encoded root\n    certificate used to validate client certificates.\nmiddleware : dict optional, default None\n    A dictionary of :class:`ServerMiddlewareFactory` instances. The\n    string keys can be used to retrieve the middleware instance within\n    RPC handlers (see :meth:`ServerCallContext.get_middleware`).")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight_FlightServerBase},
  {Py_tp_clear, (void *)__pyx_tp_clear_7pyarrow_7_flight_FlightServerBase},
  {Py_tp_methods, (void *)__pyx_methods_7pyarrow_7_flight_FlightServerBase},
  {Py_tp_getset, (void *)__pyx_getsets_7pyarrow_7_flight_FlightServerBase},
  {Py_tp_init, (void *)__pyx_pw_7pyarrow_7_flight_16FlightServerBase_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight_FlightServerBase},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight_FlightServerBase_spec = {
  "pyarrow._flight.FlightServerBase",
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase),
  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_7pyarrow_7_flight_FlightServerBase_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight_FlightServerBase = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""FlightServerBase", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight_FlightServerBase, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("FlightServerBase(location=None, auth_handler=None, tls_certificates=None, verify_client=None, root_certificates=None, middleware=None)\n\nA Flight service definition.\n\nTo start the server, create an instance of this class with an\nappropriate location. The server will be running as soon as the\ninstance is created; it is not required to call :meth:`serve`.\n\nOverride methods to define your Flight service.\n\nParameters\n----------\nlocation : str, tuple or Location optional, default None\n    Location to serve on. Either a gRPC URI like `grpc://localhost:port`,\n    a tuple of (host, port) pair, or a Location instance.\n    If None is passed then the server will be started on localhost with a\n    system provided random port.\nauth_handler : ServerAuthHandler optional, default None\n    An authentication mechanism to use. May be None.\ntls_certificates : list optional, default None\n    A list of (certificate, key) pairs.\nverify_client : boolean optional, default False\n    If True, then enable mutual TLS: require the client to present\n    a client certificate, and validate the certificate.\nroot_certificates : bytes optional, default None\n    If enabling mutual TLS, this specifies the PEM-encoded root\n    certificate used to validate client certificates.\nmiddleware : dict optional, default None\n    A dictionary of :class:`ServerMiddlewareFactory` instances. The\n    string keys can be used to retrieve the middleware instance within\n    RPC handlers (see :meth:`ServerCallContext.get_middleware`)."), /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight_FlightServerBase, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_7_flight_FlightServerBase, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_7_flight_FlightServerBase, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_7_flight_FlightServerBase, /*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_7pyarrow_7_flight_16FlightServerBase_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_7_flight_FlightServerBase, /*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 !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_7pyarrow_7_flight___pyx_scope_struct__get_flight_info(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct__get_flight_info > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct__get_flight_info[--__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct__get_flight_info];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct__get_flight_info(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct__get_flight_info) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_call);
  Py_CLEAR(p->__pyx_v_descriptor);
  Py_CLEAR(p->__pyx_v_options);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct__get_flight_info < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct__get_flight_info[__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct__get_flight_info++] = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct__get_flight_info(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_call) {
    e = (*v)(p->__pyx_v_call, a); if (e) return e;
  }
  if (p->__pyx_v_descriptor) {
    e = (*v)(((PyObject *)p->__pyx_v_descriptor), a); if (e) return e;
  }
  if (p->__pyx_v_options) {
    e = (*v)(((PyObject *)p->__pyx_v_options), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct__get_flight_info},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct__get_flight_info},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct__get_flight_info},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info_spec = {
  "pyarrow._flight.__pyx_scope_struct__get_flight_info",
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""__pyx_scope_struct__get_flight_info", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct__get_flight_info), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, /*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_7pyarrow_7_flight___pyx_scope_struct__get_flight_info, /*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 !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_7pyarrow_7_flight___pyx_scope_struct_1_do_action(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *p;
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_1_do_action > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_1_do_action[--__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_1_do_action];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *)o);
  __Pyx_default_placement_construct(&(p->__pyx_v_results));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_1_do_action(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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_7pyarrow_7_flight___pyx_scope_struct_1_do_action) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->__pyx_v_results);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_1_do_action < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_1_do_action[__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_1_do_action++] = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_1_do_action},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_1_do_action},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action_spec = {
  "pyarrow._flight.__pyx_scope_struct_1_do_action",
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER,
  __pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""__pyx_scope_struct_1_do_action", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_1_do_action), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_1_do_action, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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, /*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_7pyarrow_7_flight___pyx_scope_struct_1_do_action, /*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 !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_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response[--__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_result);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response[__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response++] = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(((PyObject *)p->__pyx_v_result), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response_spec = {
  "pyarrow._flight.__pyx_scope_struct_2__do_action_response",
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""__pyx_scope_struct_2__do_action_response", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, /*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_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response, /*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 !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_7pyarrow_7_flight___pyx_scope_struct_3_list_flights(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *p;
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_3_list_flights > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_3_list_flights[--__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_3_list_flights];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)o);
  __Pyx_default_placement_construct(&(p->__pyx_v_c_criteria));
  __Pyx_default_placement_construct(&(p->__pyx_v_listing));
  return o;
}

static void __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_3_list_flights(PyObject *o) {
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_3_list_flights) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_v_c_criteria);
  __Pyx_call_destructor(p->__pyx_v_listing);
  Py_CLEAR(p->__pyx_v_criteria);
  Py_CLEAR(p->__pyx_v_options);
  Py_CLEAR(p->__pyx_v_result);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_stop_handler);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_3_list_flights < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights))))
  {
    __pyx_mstate_global->__pyx_freelist_7pyarrow_7_flight___pyx_scope_struct_3_list_flights[__pyx_mstate_global->__pyx_freecount_7pyarrow_7_flight___pyx_scope_struct_3_list_flights++] = ((struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
}

static int __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_3_list_flights(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *p = (struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__pyx_v_options) {
    e = (*v)(((PyObject *)p->__pyx_v_options), a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(((PyObject *)p->__pyx_v_result), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_stop_handler) {
    e = (*v)(p->__pyx_v_stop_handler, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_3_list_flights},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_3_list_flights},
  {Py_tp_new, (void *)__pyx_tp_new_7pyarrow_7_flight___pyx_scope_struct_3_list_flights},
  {0, 0},
};
static PyType_Spec __pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights_spec = {
  "pyarrow._flight.__pyx_scope_struct_3_list_flights",
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights_slots,
};
#else

static PyTypeObject __pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow._flight.""__pyx_scope_struct_3_list_flights", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_7_flight___pyx_scope_struct_3_list_flights), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  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_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, /*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_7pyarrow_7_flight___pyx_scope_struct_3_list_flights, /*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 !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);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Weakrefable = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Weakrefable",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Weakrefable), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Weakrefable),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Weakrefable) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightCallOptions = &__pyx_vtable_7pyarrow_7_flight_FlightCallOptions;
  __pyx_vtable_7pyarrow_7_flight_FlightCallOptions.unwrap = ( arrow::flight::FlightCallOptions *(*)(PyObject *))__pyx_f_7pyarrow_7_flight_17FlightCallOptions_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightCallOptions_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions)) __PYX_ERR(0, 100, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightCallOptions_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions = &__pyx_type_7pyarrow_7_flight_FlightCallOptions;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 100, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_17FlightCallOptions___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_17FlightCallOptions___init__.doc = __pyx_doc_7pyarrow_7_flight_17FlightCallOptions___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_17FlightCallOptions___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions, __pyx_vtabptr_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightCallOptions, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightCallOptions, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCallOptions) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightError = &__pyx_vtable_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightError.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_11FlightError_to_status;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)(((PyTypeObject*)PyExc_Exception))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightError_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError)) __PYX_ERR(0, 184, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError = &__pyx_type_7pyarrow_7_flight_FlightError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base((((PyTypeObject*)PyExc_Exception))) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError->tp_base = (((PyTypeObject*)PyExc_Exception));
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError, __pyx_vtabptr_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 184, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightInternalError = &__pyx_vtable_7pyarrow_7_flight_FlightInternalError;
  __pyx_vtable_7pyarrow_7_flight_FlightInternalError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightInternalError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_19FlightInternalError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightTimedOutError = &__pyx_vtable_7pyarrow_7_flight_FlightTimedOutError;
  __pyx_vtable_7pyarrow_7_flight_FlightTimedOutError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightTimedOutError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_19FlightTimedOutError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightCancelledError = &__pyx_vtable_7pyarrow_7_flight_FlightCancelledError;
  __pyx_vtable_7pyarrow_7_flight_FlightCancelledError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightCancelledError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_20FlightCancelledError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightServerError = &__pyx_vtable_7pyarrow_7_flight_FlightServerError;
  __pyx_vtable_7pyarrow_7_flight_FlightServerError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightServerError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_17FlightServerError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightUnauthenticatedError = &__pyx_vtable_7pyarrow_7_flight_FlightUnauthenticatedError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnauthenticatedError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnauthenticatedError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_26FlightUnauthenticatedError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightUnauthorizedError = &__pyx_vtable_7pyarrow_7_flight_FlightUnauthorizedError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnauthorizedError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnauthorizedError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_23FlightUnauthorizedError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_FlightUnavailableError = &__pyx_vtable_7pyarrow_7_flight_FlightUnavailableError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnavailableError.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightError;
  __pyx_vtable_7pyarrow_7_flight_FlightUnavailableError.__pyx_base.to_status = (arrow::Status (*)(struct __pyx_obj_7pyarrow_7_flight_FlightError *))__pyx_f_7pyarrow_7_flight_22FlightUnavailableError_to_status;
  __pyx_vtabptr_7pyarrow_7_flight_Action = &__pyx_vtable_7pyarrow_7_flight_Action;
  __pyx_vtable_7pyarrow_7_flight_Action.unwrap = ( arrow::flight::Action (*)(PyObject *))__pyx_f_7pyarrow_7_flight_6Action_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_Action_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action)) __PYX_ERR(0, 282, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_Action_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action = &__pyx_type_7pyarrow_7_flight_Action;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 282, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_6Action___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_6Action___init__.doc = __pyx_doc_7pyarrow_7_flight_6Action___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_6Action___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_vtabptr_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Action, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_Action, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Action) < (0)) __PYX_ERR(0, 282, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_Result_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result)) __PYX_ERR(0, 361, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_Result_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result) < (0)) __PYX_ERR(0, 361, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result = &__pyx_type_7pyarrow_7_flight_Result;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result) < (0)) __PYX_ERR(0, 361, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 361, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_6Result___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_6Result___init__.doc = __pyx_doc_7pyarrow_7_flight_6Result___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_6Result___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Result, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result) < (0)) __PYX_ERR(0, 361, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_Result, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Result) < (0)) __PYX_ERR(0, 361, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_BasicAuth_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth)) __PYX_ERR(0, 410, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_BasicAuth_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth) < (0)) __PYX_ERR(0, 410, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth = &__pyx_type_7pyarrow_7_flight_BasicAuth;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth) < (0)) __PYX_ERR(0, 410, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 410, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_9BasicAuth___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_9BasicAuth___init__.doc = __pyx_doc_7pyarrow_7_flight_9BasicAuth___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_9BasicAuth___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_BasicAuth, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth) < (0)) __PYX_ERR(0, 410, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_BasicAuth, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_BasicAuth) < (0)) __PYX_ERR(0, 410, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightDescriptor = &__pyx_vtable_7pyarrow_7_flight_FlightDescriptor;
  __pyx_vtable_7pyarrow_7_flight_FlightDescriptor.unwrap = ( arrow::flight::FlightDescriptor (*)(PyObject *))__pyx_f_7pyarrow_7_flight_16FlightDescriptor_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightDescriptor_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor)) __PYX_ERR(0, 517, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightDescriptor_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor = &__pyx_type_7pyarrow_7_flight_FlightDescriptor;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_vtabptr_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightDescriptor, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightDescriptor, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor) < (0)) __PYX_ERR(0, 517, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_Ticket_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket)) __PYX_ERR(0, 612, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_Ticket_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket) < (0)) __PYX_ERR(0, 612, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket = &__pyx_type_7pyarrow_7_flight_Ticket;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket) < (0)) __PYX_ERR(0, 612, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Ticket, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket) < (0)) __PYX_ERR(0, 612, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_Ticket, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Ticket) < (0)) __PYX_ERR(0, 612, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_Location = &__pyx_vtable_7pyarrow_7_flight_Location;
  __pyx_vtable_7pyarrow_7_flight_Location.wrap = (struct __pyx_obj_7pyarrow_7_flight_Location *(*)( arrow::flight::Location))__pyx_f_7pyarrow_7_flight_8Location_wrap;
  __pyx_vtable_7pyarrow_7_flight_Location.unwrap = ( arrow::flight::Location (*)(PyObject *))__pyx_f_7pyarrow_7_flight_8Location_unwrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_Location_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location)) __PYX_ERR(0, 654, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_Location_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location = &__pyx_type_7pyarrow_7_flight_Location;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_vtabptr_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Location, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_Location, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_Location) < (0)) __PYX_ERR(0, 654, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightEndpoint_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint)) __PYX_ERR(0, 726, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightEndpoint_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint) < (0)) __PYX_ERR(0, 726, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint = &__pyx_type_7pyarrow_7_flight_FlightEndpoint;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint) < (0)) __PYX_ERR(0, 726, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 726, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_14FlightEndpoint___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_14FlightEndpoint___init__.doc = __pyx_doc_7pyarrow_7_flight_14FlightEndpoint___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_14FlightEndpoint___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightEndpoint, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint) < (0)) __PYX_ERR(0, 726, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightEndpoint, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint) < (0)) __PYX_ERR(0, 726, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_SchemaResult_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult)) __PYX_ERR(0, 851, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_SchemaResult_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult) < (0)) __PYX_ERR(0, 851, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult = &__pyx_type_7pyarrow_7_flight_SchemaResult;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult) < (0)) __PYX_ERR(0, 851, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 851, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_12SchemaResult___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_12SchemaResult___init__.doc = __pyx_doc_7pyarrow_7_flight_12SchemaResult___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_12SchemaResult___init__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SchemaResult, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult) < (0)) __PYX_ERR(0, 851, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_SchemaResult, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_SchemaResult) < (0)) __PYX_ERR(0, 851, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightInfo = &__pyx_vtable_7pyarrow_7_flight_FlightInfo;
  __pyx_vtable_7pyarrow_7_flight_FlightInfo.wrap = (PyObject *(*)( arrow::flight::FlightInfo))__pyx_f_7pyarrow_7_flight_10FlightInfo_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightInfo_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo)) __PYX_ERR(0, 907, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightInfo_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo = &__pyx_type_7pyarrow_7_flight_FlightInfo;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 907, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_10FlightInfo___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_10FlightInfo___init__.doc = __pyx_doc_7pyarrow_7_flight_10FlightInfo___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_10FlightInfo___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo, __pyx_vtabptr_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightInfo, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightInfo, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInfo) < (0)) __PYX_ERR(0, 907, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightStreamChunk_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk)) __PYX_ERR(0, 1057, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightStreamChunk_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk) < (0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk = &__pyx_type_7pyarrow_7_flight_FlightStreamChunk;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk) < (0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightStreamChunk, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk) < (0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamChunk, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamChunk) < (0)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_CRecordBatchWriter",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__CRecordBatchWriter),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_MetadataRecordBatchWriter = &__pyx_vtable_7pyarrow_7_flight_MetadataRecordBatchWriter;
  __pyx_vtable_7pyarrow_7_flight_MetadataRecordBatchWriter._writer = ( arrow::flight::MetadataRecordBatchWriter *(*)(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter *))__pyx_f_7pyarrow_7_flight_25MetadataRecordBatchWriter__writer;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter)) __PYX_ERR(0, 1197, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter = &__pyx_type_7pyarrow_7_flight_MetadataRecordBatchWriter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__CRecordBatchWriter;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_vtabptr_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter) < (0)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightStreamWriter = &__pyx_vtable_7pyarrow_7_flight_FlightStreamWriter;
  __pyx_vtable_7pyarrow_7_flight_FlightStreamWriter.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_MetadataRecordBatchWriter;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightStreamWriter_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter)) __PYX_ERR(0, 1295, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightStreamWriter_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter = &__pyx_type_7pyarrow_7_flight_FlightStreamWriter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter, __pyx_vtabptr_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightStreamWriter, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamWriter, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter) < (0)) __PYX_ERR(0, 1295, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightMetadataReader_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader)) __PYX_ERR(0, 1305, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightMetadataReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader) < (0)) __PYX_ERR(0, 1305, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader = &__pyx_type_7pyarrow_7_flight_FlightMetadataReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader) < (0)) __PYX_ERR(0, 1305, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightMetadataReader, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader) < (0)) __PYX_ERR(0, 1305, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataReader, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader) < (0)) __PYX_ERR(0, 1305, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightMetadataWriter_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter)) __PYX_ERR(0, 1321, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightMetadataWriter_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter) < (0)) __PYX_ERR(0, 1321, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter = &__pyx_type_7pyarrow_7_flight_FlightMetadataWriter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter) < (0)) __PYX_ERR(0, 1321, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightMetadataWriter, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter) < (0)) __PYX_ERR(0, 1321, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightMetadataWriter, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter) < (0)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_AsyncioFlightClient = &__pyx_vtable_7pyarrow_7_flight_AsyncioFlightClient;
  __pyx_vtable_7pyarrow_7_flight_AsyncioFlightClient._get_flight_info = (PyObject *(*)(struct __pyx_obj_7pyarrow_7_flight_AsyncioFlightClient *, PyObject *, PyObject *, PyObject *))__pyx_f_7pyarrow_7_flight_19AsyncioFlightClient__get_flight_info;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_AsyncioFlightClient_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient)) __PYX_ERR(0, 1362, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_AsyncioFlightClient_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient = &__pyx_type_7pyarrow_7_flight_AsyncioFlightClient;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient, __pyx_vtabptr_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_AsyncioFlightClient, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient) < (0)) __PYX_ERR(0, 1362, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightClient = &__pyx_vtable_7pyarrow_7_flight_FlightClient;
  __pyx_vtable_7pyarrow_7_flight_FlightClient.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_7_flight_FlightClient *, struct __pyx_obj_7pyarrow_7_flight_Location *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_7pyarrow_7_flight_12FlightClient_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightClient_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient)) __PYX_ERR(0, 1400, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightClient_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient = &__pyx_type_7pyarrow_7_flight_FlightClient;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_vtabptr_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightClient, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightClient, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightClient) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightDataStream = &__pyx_vtable_7pyarrow_7_flight_FlightDataStream;
  __pyx_vtable_7pyarrow_7_flight_FlightDataStream.to_stream = ( arrow::flight::FlightDataStream *(*)(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *))__pyx_f_7pyarrow_7_flight_16FlightDataStream_to_stream;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightDataStream_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream)) __PYX_ERR(0, 1829, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightDataStream_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream = &__pyx_type_7pyarrow_7_flight_FlightDataStream;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, __pyx_vtabptr_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightDataStream, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightDataStream) < (0)) __PYX_ERR(0, 1829, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_RecordBatchStream = &__pyx_vtable_7pyarrow_7_flight_RecordBatchStream;
  __pyx_vtable_7pyarrow_7_flight_RecordBatchStream.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightDataStream;
  __pyx_vtable_7pyarrow_7_flight_RecordBatchStream.__pyx_base.to_stream = ( arrow::flight::FlightDataStream *(*)(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *))__pyx_f_7pyarrow_7_flight_17RecordBatchStream_to_stream;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_RecordBatchStream_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream)) __PYX_ERR(0, 1848, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_RecordBatchStream_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream = &__pyx_type_7pyarrow_7_flight_RecordBatchStream;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1848, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_17RecordBatchStream___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_17RecordBatchStream___init__.doc = __pyx_doc_7pyarrow_7_flight_17RecordBatchStream___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_17RecordBatchStream___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream, __pyx_vtabptr_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_RecordBatchStream, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_RecordBatchStream, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_RecordBatchStream) < (0)) __PYX_ERR(0, 1848, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_GeneratorStream = &__pyx_vtable_7pyarrow_7_flight_GeneratorStream;
  __pyx_vtable_7pyarrow_7_flight_GeneratorStream.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_FlightDataStream;
  __pyx_vtable_7pyarrow_7_flight_GeneratorStream.__pyx_base.to_stream = ( arrow::flight::FlightDataStream *(*)(struct __pyx_obj_7pyarrow_7_flight_FlightDataStream *))__pyx_f_7pyarrow_7_flight_15GeneratorStream_to_stream;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_GeneratorStream_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream)) __PYX_ERR(0, 1890, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_GeneratorStream_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream = &__pyx_type_7pyarrow_7_flight_GeneratorStream;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1890, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_7pyarrow_7_flight_15GeneratorStream___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7pyarrow_7_flight_15GeneratorStream___init__.doc = __pyx_doc_7pyarrow_7_flight_15GeneratorStream___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7pyarrow_7_flight_15GeneratorStream___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream, __pyx_vtabptr_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_GeneratorStream, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_GeneratorStream, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_GeneratorStream) < (0)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ServerCallContext = &__pyx_vtable_7pyarrow_7_flight_ServerCallContext;
  __pyx_vtable_7pyarrow_7_flight_ServerCallContext.wrap = (struct __pyx_obj_7pyarrow_7_flight_ServerCallContext *(*)( arrow::flight::ServerCallContext const &))__pyx_f_7pyarrow_7_flight_17ServerCallContext_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerCallContext_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext)) __PYX_ERR(0, 1925, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerCallContext_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext = &__pyx_type_7pyarrow_7_flight_ServerCallContext;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_vtabptr_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerCallContext, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerCallContext, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerCallContext) < (0)) __PYX_ERR(0, 1925, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ServerAuthReader = &__pyx_vtable_7pyarrow_7_flight_ServerAuthReader;
  __pyx_vtable_7pyarrow_7_flight_ServerAuthReader.poison = (void (*)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *))__pyx_f_7pyarrow_7_flight_16ServerAuthReader_poison;
  __pyx_vtable_7pyarrow_7_flight_ServerAuthReader.wrap = (struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader *(*)( arrow::flight::ServerAuthReader *))__pyx_f_7pyarrow_7_flight_16ServerAuthReader_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerAuthReader_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader)) __PYX_ERR(0, 1989, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerAuthReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader = &__pyx_type_7pyarrow_7_flight_ServerAuthReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader, __pyx_vtabptr_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerAuthReader, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthReader, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader) < (0)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ServerAuthSender = &__pyx_vtable_7pyarrow_7_flight_ServerAuthSender;
  __pyx_vtable_7pyarrow_7_flight_ServerAuthSender.poison = (void (*)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *))__pyx_f_7pyarrow_7_flight_16ServerAuthSender_poison;
  __pyx_vtable_7pyarrow_7_flight_ServerAuthSender.wrap = (struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender *(*)( arrow::flight::ServerAuthSender *))__pyx_f_7pyarrow_7_flight_16ServerAuthSender_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerAuthSender_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender)) __PYX_ERR(0, 2020, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerAuthSender_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender = &__pyx_type_7pyarrow_7_flight_ServerAuthSender;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender, __pyx_vtabptr_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerAuthSender, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthSender, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender) < (0)) __PYX_ERR(0, 2020, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ClientAuthReader = &__pyx_vtable_7pyarrow_7_flight_ClientAuthReader;
  __pyx_vtable_7pyarrow_7_flight_ClientAuthReader.poison = (void (*)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *))__pyx_f_7pyarrow_7_flight_16ClientAuthReader_poison;
  __pyx_vtable_7pyarrow_7_flight_ClientAuthReader.wrap = (struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader *(*)( arrow::flight::ClientAuthReader *))__pyx_f_7pyarrow_7_flight_16ClientAuthReader_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ClientAuthReader_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader)) __PYX_ERR(0, 2050, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ClientAuthReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader = &__pyx_type_7pyarrow_7_flight_ClientAuthReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader, __pyx_vtabptr_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ClientAuthReader, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthReader, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader) < (0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ClientAuthSender = &__pyx_vtable_7pyarrow_7_flight_ClientAuthSender;
  __pyx_vtable_7pyarrow_7_flight_ClientAuthSender.poison = (void (*)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *))__pyx_f_7pyarrow_7_flight_16ClientAuthSender_poison;
  __pyx_vtable_7pyarrow_7_flight_ClientAuthSender.wrap = (struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender *(*)( arrow::flight::ClientAuthSender *))__pyx_f_7pyarrow_7_flight_16ClientAuthSender_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ClientAuthSender_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender)) __PYX_ERR(0, 2081, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ClientAuthSender_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender = &__pyx_type_7pyarrow_7_flight_ClientAuthSender;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender, __pyx_vtabptr_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ClientAuthSender, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthSender, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender) < (0)) __PYX_ERR(0, 2081, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ServerAuthHandler = &__pyx_vtable_7pyarrow_7_flight_ServerAuthHandler;
  __pyx_vtable_7pyarrow_7_flight_ServerAuthHandler.to_handler = ( arrow::py::flight::PyServerAuthHandler *(*)(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *))__pyx_f_7pyarrow_7_flight_17ServerAuthHandler_to_handler;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerAuthHandler_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler)) __PYX_ERR(0, 2545, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerAuthHandler_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler = &__pyx_type_7pyarrow_7_flight_ServerAuthHandler;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler, __pyx_vtabptr_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerAuthHandler, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler) < (0)) __PYX_ERR(0, 2545, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ClientAuthHandler = &__pyx_vtable_7pyarrow_7_flight_ClientAuthHandler;
  __pyx_vtable_7pyarrow_7_flight_ClientAuthHandler.to_handler = ( arrow::py::flight::PyClientAuthHandler *(*)(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler *))__pyx_f_7pyarrow_7_flight_17ClientAuthHandler_to_handler;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ClientAuthHandler_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler)) __PYX_ERR(0, 2589, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ClientAuthHandler_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler = &__pyx_type_7pyarrow_7_flight_ClientAuthHandler;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler, __pyx_vtabptr_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ClientAuthHandler, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ClientAuthHandler, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler) < (0)) __PYX_ERR(0, 2589, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory)) __PYX_ERR(0, 2627, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory) < (0)) __PYX_ERR(0, 2627, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory = &__pyx_type_7pyarrow_7_flight_ClientMiddlewareFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory) < (0)) __PYX_ERR(0, 2627, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ClientMiddlewareFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory) < (0)) __PYX_ERR(0, 2627, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddlewareFactory, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory) < (0)) __PYX_ERR(0, 2627, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ClientMiddleware = &__pyx_vtable_7pyarrow_7_flight_ClientMiddleware;
  __pyx_vtable_7pyarrow_7_flight_ClientMiddleware.wrap = (void (*)(PyObject *, std::unique_ptr< arrow::flight::ClientMiddleware>  *))__pyx_f_7pyarrow_7_flight_16ClientMiddleware_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ClientMiddleware_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware)) __PYX_ERR(0, 2655, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ClientMiddleware_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware = &__pyx_type_7pyarrow_7_flight_ClientMiddleware;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __pyx_vtabptr_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ClientMiddleware, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ClientMiddleware, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware) < (0)) __PYX_ERR(0, 2655, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory)) __PYX_ERR(0, 2718, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2718, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory = &__pyx_type_7pyarrow_7_flight_ServerMiddlewareFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2718, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2718, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddlewareFactory, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2718, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory)) __PYX_ERR(0, 2756, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2756, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory = &__pyx_type_7pyarrow_7_flight_TracingServerMiddlewareFactory;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2756, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TracingServerMiddlewareFactory, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2756, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_TracingServerMiddlewareFactory, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory) < (0)) __PYX_ERR(0, 2756, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_ServerMiddleware = &__pyx_vtable_7pyarrow_7_flight_ServerMiddleware;
  __pyx_vtable_7pyarrow_7_flight_ServerMiddleware.wrap = (void (*)(PyObject *, std::shared_ptr< arrow::flight::ServerMiddleware>  *))__pyx_f_7pyarrow_7_flight_16ServerMiddleware_wrap;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_ServerMiddleware_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware)) __PYX_ERR(0, 2772, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_ServerMiddleware_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware = &__pyx_type_7pyarrow_7_flight_ServerMiddleware;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, __pyx_vtabptr_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerMiddleware, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_ServerMiddleware, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware) < (0)) __PYX_ERR(0, 2772, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper)) __PYX_ERR(0, 2825, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper) < (0)) __PYX_ERR(0, 2825, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper = &__pyx_type_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper) < (0)) __PYX_ERR(0, 2825, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactoryWrapper, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper) < (0)) __PYX_ERR(0, 2825, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper) < (0)) __PYX_ERR(0, 2825, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight__ServerMiddlewareWrapper = &__pyx_vtable_7pyarrow_7_flight__ServerMiddlewareWrapper;
  __pyx_vtable_7pyarrow_7_flight__ServerMiddlewareWrapper.__pyx_base = *__pyx_vtabptr_7pyarrow_7_flight_ServerMiddleware;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper)) __PYX_ERR(0, 2846, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper = &__pyx_type_7pyarrow_7_flight__ServerMiddlewareWrapper;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_vtabptr_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareWrapper, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper) < (0)) __PYX_ERR(0, 2846, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight__FlightServerFinalizer_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer)) __PYX_ERR(0, 2874, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight__FlightServerFinalizer_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer) < (0)) __PYX_ERR(0, 2874, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer = &__pyx_type_7pyarrow_7_flight__FlightServerFinalizer;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer) < (0)) __PYX_ERR(0, 2874, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightServerFinalizer, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer) < (0)) __PYX_ERR(0, 2874, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight__FlightServerFinalizer, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer) < (0)) __PYX_ERR(0, 2874, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_7_flight_FlightServerBase = &__pyx_vtable_7pyarrow_7_flight_FlightServerBase;
  __pyx_vtable_7pyarrow_7_flight_FlightServerBase.init = (PyObject *(*)(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase *, struct __pyx_obj_7pyarrow_7_flight_Location *, struct __pyx_obj_7pyarrow_7_flight_ServerAuthHandler *, PyObject *, bool, PyObject *, PyObject *))__pyx_f_7pyarrow_7_flight_16FlightServerBase_init;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightServerBase_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase)) __PYX_ERR(0, 2901, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightServerBase_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase = &__pyx_type_7pyarrow_7_flight_FlightServerBase;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_vtabptr_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightServerBase, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightServerBase, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerBase) < (0)) __PYX_ERR(0, 2901, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info)) __PYX_ERR(0, 1375, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info = &__pyx_type_7pyarrow_7_flight___pyx_scope_struct__get_flight_info;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct__get_flight_info->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action)) __PYX_ERR(0, 1629, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action) < (0)) __PYX_ERR(0, 1629, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action = &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_1_do_action;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action) < (0)) __PYX_ERR(0, 1629, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_1_do_action->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response)) __PYX_ERR(0, 1662, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response = &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response) < (0)) __PYX_ERR(0, 1662, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_2__do_action_response->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights)) __PYX_ERR(0, 1674, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights) < (0)) __PYX_ERR(0, 1674, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights = &__pyx_type_7pyarrow_7_flight___pyx_scope_struct_3_list_flights;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights) < (0)) __PYX_ERR(0, 1674, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights->tp_dictoffset && __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_7pyarrow_7_flight___pyx_scope_struct_3_list_flights->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_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_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyLongObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyLongObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_2_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyComplexObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  0, 0,
  #else
  sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyComplexObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "date",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #else
  sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Date),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(3, 43, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "time",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #else
  sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Time),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(3, 56, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "datetime",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #else
  sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_DateTime),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(3, 82, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "timedelta",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #else
  sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_Delta),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(3, 120, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_2_4(__pyx_t_1, "datetime", "tzinfo",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #else
  sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(PyDateTime_TZInfo),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(3, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IpcWriteOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcWriteOptions) __PYX_ERR(7, 41, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcReadOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IpcReadOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IpcReadOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IpcReadOptions) __PYX_ERR(7, 49, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Message = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Message",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Message), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Message),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Message) __PYX_ERR(7, 60, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MemoryPool",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryPool), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryPool),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool) __PYX_ERR(7, 65, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MemoryPool = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryPool*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryPool); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MemoryPool)) __PYX_ERR(7, 65, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DataType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DataType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DataType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType) __PYX_ERR(7, 78, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DataType = (struct __pyx_vtabstruct_7pyarrow_3lib_DataType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DataType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DataType)) __PYX_ERR(7, 78, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType) __PYX_ERR(7, 88, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListType = (struct __pyx_vtabstruct_7pyarrow_3lib_ListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListType)) __PYX_ERR(7, 88, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType) __PYX_ERR(7, 93, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListType = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListType)) __PYX_ERR(7, 93, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListViewType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType) __PYX_ERR(7, 98, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListViewType = (struct __pyx_vtabstruct_7pyarrow_3lib_ListViewType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListViewType)) __PYX_ERR(7, 98, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListViewType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType) __PYX_ERR(7, 103, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListViewType = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListViewType)) __PYX_ERR(7, 103, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MapType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType) __PYX_ERR(7, 108, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MapType = (struct __pyx_vtabstruct_7pyarrow_3lib_MapType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MapType)) __PYX_ERR(7, 108, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeListType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType) __PYX_ERR(7, 113, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeListType)) __PYX_ERR(7, 113, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StructType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType) __PYX_ERR(7, 118, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StructType = (struct __pyx_vtabstruct_7pyarrow_3lib_StructType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StructType)) __PYX_ERR(7, 118, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryMemo = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryMemo",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryMemo),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryMemo) __PYX_ERR(7, 125, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType) __PYX_ERR(7, 133, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DictionaryType = (struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DictionaryType)) __PYX_ERR(7, 133, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "TimestampType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_TimestampType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_TimestampType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType) __PYX_ERR(7, 138, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_TimestampType = (struct __pyx_vtabstruct_7pyarrow_3lib_TimestampType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_TimestampType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_TimestampType)) __PYX_ERR(7, 138, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Time32Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time32Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type) __PYX_ERR(7, 143, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Time32Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Time32Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time32Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Time32Type)) __PYX_ERR(7, 143, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Time64Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Time64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Time64Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type) __PYX_ERR(7, 148, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Time64Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Time64Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Time64Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Time64Type)) __PYX_ERR(7, 148, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DurationType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DurationType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DurationType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType) __PYX_ERR(7, 153, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DurationType = (struct __pyx_vtabstruct_7pyarrow_3lib_DurationType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DurationType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DurationType)) __PYX_ERR(7, 153, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeBinaryType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType) __PYX_ERR(7, 158, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryType)) __PYX_ERR(7, 158, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal32Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type) __PYX_ERR(7, 163, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal32Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal32Type)) __PYX_ERR(7, 163, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal64Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type) __PYX_ERR(7, 168, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal64Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal64Type)) __PYX_ERR(7, 168, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal128Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type) __PYX_ERR(7, 173, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal128Type)) __PYX_ERR(7, 173, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal256Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type) __PYX_ERR(7, 178, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal256Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal256Type)) __PYX_ERR(7, 178, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RunEndEncodedType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RunEndEncodedType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType) __PYX_ERR(7, 183, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType = (struct __pyx_vtabstruct_7pyarrow_3lib_RunEndEncodedType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RunEndEncodedType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_RunEndEncodedType)) __PYX_ERR(7, 183, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BaseExtensionType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseExtensionType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType) __PYX_ERR(7, 188, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BaseExtensionType = (struct __pyx_vtabstruct_7pyarrow_3lib_BaseExtensionType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseExtensionType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BaseExtensionType)) __PYX_ERR(7, 188, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ExtensionType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType) __PYX_ERR(7, 193, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ExtensionType = (struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ExtensionType)) __PYX_ERR(7, 193, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedShapeTensorType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedShapeTensorType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType) __PYX_ERR(7, 198, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedShapeTensorType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedShapeTensorType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedShapeTensorType)) __PYX_ERR(7, 198, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Bool8Type",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Bool8Type), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Bool8Type),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type) __PYX_ERR(7, 202, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Bool8Type = (struct __pyx_vtabstruct_7pyarrow_3lib_Bool8Type*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Bool8Type); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Bool8Type)) __PYX_ERR(7, 202, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "OpaqueType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_OpaqueType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_OpaqueType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType) __PYX_ERR(7, 206, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_OpaqueType = (struct __pyx_vtabstruct_7pyarrow_3lib_OpaqueType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_OpaqueType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_OpaqueType)) __PYX_ERR(7, 206, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UuidType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UuidType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UuidType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType) __PYX_ERR(7, 210, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UuidType = (struct __pyx_vtabstruct_7pyarrow_3lib_UuidType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UuidType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UuidType)) __PYX_ERR(7, 210, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "JsonType",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_JsonType), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_JsonType),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType) __PYX_ERR(7, 214, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_JsonType = (struct __pyx_vtabstruct_7pyarrow_3lib_JsonType*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_JsonType); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_JsonType)) __PYX_ERR(7, 214, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Metadata = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Metadata",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Metadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Metadata),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Metadata) __PYX_ERR(7, 219, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "KeyValueMetadata",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_KeyValueMetadata),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata) __PYX_ERR(7, 225, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata = (struct __pyx_vtabstruct_7pyarrow_3lib_KeyValueMetadata*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_KeyValueMetadata); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_KeyValueMetadata)) __PYX_ERR(7, 225, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Field",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Field), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Field),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field) __PYX_ERR(7, 237, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Field = (struct __pyx_vtabstruct_7pyarrow_3lib_Field*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Field); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Field)) __PYX_ERR(7, 237, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Schema",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Schema), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Schema),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema) __PYX_ERR(7, 248, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Schema = (struct __pyx_vtabstruct_7pyarrow_3lib_Schema*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Schema); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Schema)) __PYX_ERR(7, 248, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Scalar",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Scalar), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Scalar),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar) __PYX_ERR(7, 257, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Scalar = (struct __pyx_vtabstruct_7pyarrow_3lib_Scalar*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Scalar); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Scalar)) __PYX_ERR(7, 257, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ArrayStatistics",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ArrayStatistics),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics) __PYX_ERR(7, 269, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ArrayStatistics = (struct __pyx_vtabstruct_7pyarrow_3lib_ArrayStatistics*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ArrayStatistics); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ArrayStatistics)) __PYX_ERR(7, 269, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__PandasConvertible = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_PandasConvertible",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__PandasConvertible), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__PandasConvertible),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__PandasConvertible) __PYX_ERR(7, 277, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array) __PYX_ERR(7, 281, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Array)) __PYX_ERR(7, 281, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Tensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Tensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Tensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor) __PYX_ERR(7, 297, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Tensor = (struct __pyx_vtabstruct_7pyarrow_3lib_Tensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Tensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Tensor)) __PYX_ERR(7, 297, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSRMatrix",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSRMatrix),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix) __PYX_ERR(7, 310, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSRMatrix*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSRMatrix); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSRMatrix)) __PYX_ERR(7, 310, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSCMatrix",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSCMatrix),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix) __PYX_ERR(7, 321, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSCMatrix*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSCMatrix); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSCMatrix)) __PYX_ERR(7, 321, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCOOTensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCOOTensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor) __PYX_ERR(7, 332, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCOOTensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCOOTensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCOOTensor)) __PYX_ERR(7, 332, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "SparseCSFTensor",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_SparseCSFTensor),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor) __PYX_ERR(7, 343, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor = (struct __pyx_vtabstruct_7pyarrow_3lib_SparseCSFTensor*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_SparseCSFTensor); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_SparseCSFTensor)) __PYX_ERR(7, 343, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NullArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NullArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NullArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray) __PYX_ERR(7, 354, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NullArray = (struct __pyx_vtabstruct_7pyarrow_3lib_NullArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NullArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NullArray)) __PYX_ERR(7, 354, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BooleanArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BooleanArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BooleanArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray) __PYX_ERR(7, 358, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BooleanArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BooleanArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BooleanArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BooleanArray)) __PYX_ERR(7, 358, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NumericArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NumericArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NumericArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray) __PYX_ERR(7, 362, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NumericArray = (struct __pyx_vtabstruct_7pyarrow_3lib_NumericArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NumericArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NumericArray)) __PYX_ERR(7, 362, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "IntegerArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_IntegerArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_IntegerArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray) __PYX_ERR(7, 366, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_IntegerArray = (struct __pyx_vtabstruct_7pyarrow_3lib_IntegerArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_IntegerArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_IntegerArray)) __PYX_ERR(7, 366, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FloatingPointArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatingPointArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray) __PYX_ERR(7, 370, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FloatingPointArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FloatingPointArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatingPointArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FloatingPointArray)) __PYX_ERR(7, 370, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int8Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int8Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array) __PYX_ERR(7, 374, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int8Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int8Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int8Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int8Array)) __PYX_ERR(7, 374, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt8Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt8Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt8Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array) __PYX_ERR(7, 378, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt8Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt8Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt8Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt8Array)) __PYX_ERR(7, 378, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int16Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int16Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array) __PYX_ERR(7, 382, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int16Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int16Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int16Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int16Array)) __PYX_ERR(7, 382, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt16Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt16Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt16Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array) __PYX_ERR(7, 386, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt16Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt16Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt16Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt16Array)) __PYX_ERR(7, 386, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array) __PYX_ERR(7, 390, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int32Array)) __PYX_ERR(7, 390, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array) __PYX_ERR(7, 394, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt32Array)) __PYX_ERR(7, 394, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Int64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Int64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Int64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array) __PYX_ERR(7, 398, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Int64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Int64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Int64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Int64Array)) __PYX_ERR(7, 398, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UInt64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UInt64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UInt64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array) __PYX_ERR(7, 402, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UInt64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_UInt64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UInt64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UInt64Array)) __PYX_ERR(7, 402, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "HalfFloatArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_HalfFloatArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray) __PYX_ERR(7, 406, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_HalfFloatArray = (struct __pyx_vtabstruct_7pyarrow_3lib_HalfFloatArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_HalfFloatArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_HalfFloatArray)) __PYX_ERR(7, 406, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FloatArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FloatArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FloatArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray) __PYX_ERR(7, 410, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FloatArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FloatArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FloatArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FloatArray)) __PYX_ERR(7, 410, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DoubleArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DoubleArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DoubleArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray) __PYX_ERR(7, 414, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DoubleArray = (struct __pyx_vtabstruct_7pyarrow_3lib_DoubleArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DoubleArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DoubleArray)) __PYX_ERR(7, 414, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeBinaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray) __PYX_ERR(7, 418, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeBinaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeBinaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeBinaryArray)) __PYX_ERR(7, 418, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal32Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal32Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal32Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array) __PYX_ERR(7, 422, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal32Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal32Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal32Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal32Array)) __PYX_ERR(7, 422, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal64Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal64Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal64Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array) __PYX_ERR(7, 426, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal64Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal64Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal64Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal64Array)) __PYX_ERR(7, 426, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal128Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal128Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal128Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array) __PYX_ERR(7, 430, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal128Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal128Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal128Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal128Array)) __PYX_ERR(7, 430, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Decimal256Array",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Decimal256Array), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Decimal256Array),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array) __PYX_ERR(7, 434, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Decimal256Array = (struct __pyx_vtabstruct_7pyarrow_3lib_Decimal256Array*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Decimal256Array); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Decimal256Array)) __PYX_ERR(7, 434, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StructArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StructArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StructArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray) __PYX_ERR(7, 438, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StructArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StructArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StructArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StructArray)) __PYX_ERR(7, 438, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BaseListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BaseListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BaseListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray) __PYX_ERR(7, 442, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BaseListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BaseListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BaseListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BaseListArray)) __PYX_ERR(7, 442, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray) __PYX_ERR(7, 446, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListArray)) __PYX_ERR(7, 446, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray) __PYX_ERR(7, 450, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListArray)) __PYX_ERR(7, 450, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ListViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ListViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray) __PYX_ERR(7, 454, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ListViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ListViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ListViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ListViewArray)) __PYX_ERR(7, 454, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "LargeListViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_LargeListViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray) __PYX_ERR(7, 458, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_LargeListViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_LargeListViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_LargeListViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_LargeListViewArray)) __PYX_ERR(7, 458, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MapArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MapArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MapArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray) __PYX_ERR(7, 462, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MapArray = (struct __pyx_vtabstruct_7pyarrow_3lib_MapArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MapArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MapArray)) __PYX_ERR(7, 462, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "FixedSizeListArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_FixedSizeListArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray) __PYX_ERR(7, 466, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray = (struct __pyx_vtabstruct_7pyarrow_3lib_FixedSizeListArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_FixedSizeListArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_FixedSizeListArray)) __PYX_ERR(7, 466, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "UnionArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_UnionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_UnionArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray) __PYX_ERR(7, 470, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_UnionArray = (struct __pyx_vtabstruct_7pyarrow_3lib_UnionArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_UnionArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_UnionArray)) __PYX_ERR(7, 470, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StringArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray) __PYX_ERR(7, 474, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StringArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StringArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StringArray)) __PYX_ERR(7, 474, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BinaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray) __PYX_ERR(7, 478, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BinaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BinaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BinaryArray)) __PYX_ERR(7, 478, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StringViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StringViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StringViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray) __PYX_ERR(7, 482, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StringViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_StringViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StringViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StringViewArray)) __PYX_ERR(7, 482, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BinaryViewArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BinaryViewArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray) __PYX_ERR(7, 486, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BinaryViewArray = (struct __pyx_vtabstruct_7pyarrow_3lib_BinaryViewArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BinaryViewArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BinaryViewArray)) __PYX_ERR(7, 486, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "DictionaryArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_DictionaryArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_DictionaryArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray) __PYX_ERR(7, 490, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_DictionaryArray = (struct __pyx_vtabstruct_7pyarrow_3lib_DictionaryArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_DictionaryArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_DictionaryArray)) __PYX_ERR(7, 490, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ExtensionArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ExtensionArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ExtensionArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray) __PYX_ERR(7, 495, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ExtensionArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ExtensionArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ExtensionArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ExtensionArray)) __PYX_ERR(7, 495, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MonthDayNanoIntervalArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MonthDayNanoIntervalArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray) __PYX_ERR(7, 499, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray = (struct __pyx_vtabstruct_7pyarrow_3lib_MonthDayNanoIntervalArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MonthDayNanoIntervalArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MonthDayNanoIntervalArray)) __PYX_ERR(7, 499, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ChunkedArray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ChunkedArray), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ChunkedArray),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray) __PYX_ERR(7, 507, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ChunkedArray = (struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ChunkedArray); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ChunkedArray)) __PYX_ERR(7, 507, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "_Tabular",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib__Tabular), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib__Tabular),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular) __PYX_ERR(7, 522, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib__Tabular = (struct __pyx_vtabstruct_7pyarrow_3lib__Tabular*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib__Tabular); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib__Tabular)) __PYX_ERR(7, 522, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Table",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Table), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Table),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table) __PYX_ERR(7, 526, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Table = (struct __pyx_vtabstruct_7pyarrow_3lib_Table*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Table); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Table)) __PYX_ERR(7, 526, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RecordBatch",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatch), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatch),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch) __PYX_ERR(7, 536, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_RecordBatch = (struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatch); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_RecordBatch)) __PYX_ERR(7, 536, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Device",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Device), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Device),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device) __PYX_ERR(7, 545, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Device = (struct __pyx_vtabstruct_7pyarrow_3lib_Device*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Device); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Device)) __PYX_ERR(7, 545, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "MemoryManager",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_MemoryManager), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_MemoryManager),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager) __PYX_ERR(7, 557, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_MemoryManager = (struct __pyx_vtabstruct_7pyarrow_3lib_MemoryManager*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_MemoryManager); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_MemoryManager)) __PYX_ERR(7, 557, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Buffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Buffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Buffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer) __PYX_ERR(7, 569, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Buffer = (struct __pyx_vtabstruct_7pyarrow_3lib_Buffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Buffer); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Buffer)) __PYX_ERR(7, 569, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "ResizableBuffer",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_ResizableBuffer),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer) __PYX_ERR(7, 579, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_ResizableBuffer = (struct __pyx_vtabstruct_7pyarrow_3lib_ResizableBuffer*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_ResizableBuffer); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_ResizableBuffer)) __PYX_ERR(7, 579, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "NativeFile",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_NativeFile), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_NativeFile),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile) __PYX_ERR(7, 584, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_NativeFile = (struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_NativeFile); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_NativeFile)) __PYX_ERR(7, 584, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BufferedInputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedInputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream) __PYX_ERR(7, 608, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BufferedInputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_BufferedInputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedInputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BufferedInputStream)) __PYX_ERR(7, 608, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "BufferedOutputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_BufferedOutputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream) __PYX_ERR(7, 612, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_BufferedOutputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_BufferedOutputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_BufferedOutputStream)) __PYX_ERR(7, 612, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CompressedInputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedInputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream) __PYX_ERR(7, 616, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CompressedInputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_CompressedInputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedInputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CompressedInputStream)) __PYX_ERR(7, 616, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CompressedOutputStream",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CompressedOutputStream),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream) __PYX_ERR(7, 620, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream = (struct __pyx_vtabstruct_7pyarrow_3lib_CompressedOutputStream*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CompressedOutputStream); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CompressedOutputStream)) __PYX_ERR(7, 620, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatchReader = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "RecordBatchReader",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_RecordBatchReader),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_RecordBatchReader) __PYX_ERR(7, 629, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "CacheOptions",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_CacheOptions), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_CacheOptions),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions) __PYX_ERR(7, 634, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_CacheOptions = (struct __pyx_vtabstruct_7pyarrow_3lib_CacheOptions*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_CacheOptions); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_CacheOptions)) __PYX_ERR(7, 634, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "Codec",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_Codec), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_Codec),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec) __PYX_ERR(7, 646, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_Codec = (struct __pyx_vtabstruct_7pyarrow_3lib_Codec*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_Codec); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_Codec)) __PYX_ERR(7, 646, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken = __Pyx_ImportType_3_2_4(__pyx_t_1, "pyarrow.lib", "StopToken",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #else
  sizeof(struct __pyx_obj_7pyarrow_3lib_StopToken), __PYX_GET_STRUCT_ALIGNMENT_3_2_4(struct __pyx_obj_7pyarrow_3lib_StopToken),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_4); if (!__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken) __PYX_ERR(7, 654, __pyx_L1_error)
  __pyx_vtabptr_7pyarrow_3lib_StopToken = (struct __pyx_vtabstruct_7pyarrow_3lib_StopToken*)__Pyx_GetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_3lib_StopToken); if (unlikely(!__pyx_vtabptr_7pyarrow_3lib_StopToken)) __PYX_ERR(7, 654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(__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);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  {
    __pyx_t_1 = PyImport_ImportModule("pyarrow.lib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_import_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_PyObject_arrow_ipc_ReadStats_PyO);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_import_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_import_name = __pyx_import_signature + 527;
    void (**const __pyx_import_pointers[])(void) = {(void (**)(void))&__pyx_f_7pyarrow_3lib__wrap_read_stats, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_batch, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_schema, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_wrap_table, (void (**)(void))&__pyx_f_7pyarrow_3lib_check_status, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer, (void (**)(void))&__pyx_f_7pyarrow_3lib_pyarrow_unwrap_schema, (void (**)(void))&__pyx_f_7pyarrow_3lib_wrap_ipc_read_options, (void (**)(void))&__pyx_f_7pyarrow_3lib_wrap_ipc_write_options, (void (**)(void)) NULL};
    void (**const *__pyx_import_pointer)(void) = __pyx_import_pointers;
    const char *__pyx_import_current_signature = __pyx_import_signature;
    while (*__pyx_import_pointer) {
      if (__Pyx_ImportFunction_3_2_4(__pyx_t_1, __pyx_import_name, *__pyx_import_pointer, __pyx_import_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_import_pointer;
      __pyx_import_name = strchr(__pyx_import_name, '\0') + 1;
      __pyx_import_signature = strchr(__pyx_import_signature, '\0') + 1;
      if (*__pyx_import_signature != '\0') __pyx_import_current_signature = __pyx_import_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__flight(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__flight},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #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,
      "_flight",
      0, /* 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__flight(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__flight(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
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 && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#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__flight(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;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PyTypeObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_flight' 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 "_flight" 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_NOT_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__flight", 0);
  __Pyx_init_runtime_version();
  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)
  __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)
  /*--- 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_pyarrow___flight) {
    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, "pyarrow._flight")) {
      if (unlikely((PyDict_SetItemString(modules, "pyarrow._flight", __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);
  (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/

  /* "pyarrow/_flight.pyx":20
 * # cython: language_level = 3
 * 
 * import collections             # <<<<<<<<<<<<<<
 * import enum
 * import re
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_collections, __pyx_t_2) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":21
 * 
 * import collections
 * import enum             # <<<<<<<<<<<<<<
 * import re
 * import time
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_enum, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __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, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":22
 * import collections
 * import enum
 * import re             # <<<<<<<<<<<<<<
 * import time
 * import warnings
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_2) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":23
 * import enum
 * import re
 * import time             # <<<<<<<<<<<<<<
 * import warnings
 * import weakref
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_time, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_time, __pyx_t_2) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":24
 * import re
 * import time
 * import warnings             # <<<<<<<<<<<<<<
 * import weakref
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":25
 * import time
 * import warnings
 * import weakref             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_weakref, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_weakref, __pyx_t_2) < (0)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":32
 * 
 * from pyarrow.lib cimport *
 * from pyarrow.lib import (ArrowCancelled, ArrowException, ArrowInvalid,             # <<<<<<<<<<<<<<
 *                          SignalStopHandler)
 * from pyarrow.lib import as_buffer, frombytes, timestamp, tobytes
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ArrowCancelled,__pyx_mstate_global->__pyx_n_u_ArrowException,__pyx_mstate_global->__pyx_n_u_ArrowInvalid,__pyx_mstate_global->__pyx_n_u_SignalStopHandler};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_lib, __pyx_imported_names, 4, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ArrowCancelled,__pyx_mstate_global->__pyx_n_u_ArrowException,__pyx_mstate_global->__pyx_n_u_ArrowInvalid,__pyx_mstate_global->__pyx_n_u_SignalStopHandler};
    for (__pyx_t_3=0; __pyx_t_3 < 4; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 32, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":34
 * from pyarrow.lib import (ArrowCancelled, ArrowException, ArrowInvalid,
 *                          SignalStopHandler)
 * from pyarrow.lib import as_buffer, frombytes, timestamp, tobytes             # <<<<<<<<<<<<<<
 * from pyarrow.includes.libarrow_flight cimport *
 * from pyarrow.ipc import _get_legacy_format_default, _ReadPandasMixin
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_as_buffer,__pyx_mstate_global->__pyx_n_u_frombytes,__pyx_mstate_global->__pyx_n_u_timestamp,__pyx_mstate_global->__pyx_n_u_tobytes};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_lib, __pyx_imported_names, 4, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_as_buffer,__pyx_mstate_global->__pyx_n_u_frombytes,__pyx_mstate_global->__pyx_n_u_timestamp,__pyx_mstate_global->__pyx_n_u_tobytes};
    for (__pyx_t_3=0; __pyx_t_3 < 4; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 34, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":36
 * from pyarrow.lib import as_buffer, frombytes, timestamp, tobytes
 * from pyarrow.includes.libarrow_flight cimport *
 * from pyarrow.ipc import _get_legacy_format_default, _ReadPandasMixin             # <<<<<<<<<<<<<<
 * import pyarrow.lib as lib
 * 
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_get_legacy_format_default,__pyx_mstate_global->__pyx_n_u_ReadPandasMixin};
    __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_ipc, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_get_legacy_format_default,__pyx_mstate_global->__pyx_n_u_ReadPandasMixin};
    for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":37
 * from pyarrow.includes.libarrow_flight cimport *
 * from pyarrow.ipc import _get_legacy_format_default, _ReadPandasMixin
 * import pyarrow.lib as lib             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_pyarrow_lib, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_lib);
  Py_DECREF(__pyx_t_1);
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_2 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_lib, __pyx_t_2) < (0)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":81
 * 
 * 
 * _FLIGHT_SERVER_ERROR_REGEX = re.compile(             # <<<<<<<<<<<<<<
 *     r'Flight RPC failed with message: (.*). Detail: '
 *     r'Python exception: (.*)',
*/
  __pyx_t_4 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":84
 *     r'Flight RPC failed with message: (.*). Detail: '
 *     r'Python exception: (.*)',
 *     re.DOTALL             # <<<<<<<<<<<<<<
 * )
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_DOTALL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Flight_RPC_failed_with_message_D, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__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_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FLIGHT_SERVER_ERROR_REGEX, __pyx_t_2) < (0)) __PYX_ERR(0, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":88
 * 
 * 
 * def _munge_grpc_python_error(message):             # <<<<<<<<<<<<<<
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_1_munge_grpc_python_error, 0, __pyx_mstate_global->__pyx_n_u_munge_grpc_python_error, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_munge_grpc_python_error, __pyx_t_2) < (0)) __PYX_ERR(0, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightCallOptions_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightCallOptions___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.options cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightCallOptions_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightCallOptions___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":177
 * 
 * 
 * _CertKeyPair = collections.namedtuple('_CertKeyPair', ['cert', 'key'])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_7 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_namedtuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_cert, __pyx_mstate_global->__pyx_n_u_key); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_CertKeyPair, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_2)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CertKeyPair, __pyx_t_2) < (0)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":180
 * 
 * 
 * class CertKeyPair(_CertKeyPair):             # <<<<<<<<<<<<<<
 *     """A TLS certificate and key for use in Flight."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CertKeyPair); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __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, 180, __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_CertKeyPair_2, __pyx_mstate_global->__pyx_n_u_CertKeyPair_2, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_A_TLS_certificate_and_key_for_us); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 180, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_CertKeyPair_2, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CertKeyPair_2, __pyx_t_4) < (0)) __PYX_ERR(0, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11FlightError_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightError___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11FlightError_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightError___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":217
 * 
 * 
 * cdef class FlightInternalError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """An error internal to the Flight server occurred."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightInternalError, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_4, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 217, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_7 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = PyNumber_Add(__pyx_t_6, __pyx_t_4);
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyObject_Call(__pyx_t_7, __pyx_t_11, NULL);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else
  #endif
  __pyx_t_8 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_4, NULL);
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_8, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_8, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 217, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightInternalError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightInternalError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError)) __PYX_ERR(0, 217, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightInternalError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightInternalError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError = &__pyx_type_7pyarrow_7_flight_FlightInternalError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightInternalError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInternalError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError, __pyx_vtabptr_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightInternalError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightInternalError) < (0)) __PYX_ERR(0, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19FlightInternalError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInternalError___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInternalError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightInternalError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightInternalError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19FlightInternalError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInternalError___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInternalError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":225
 * 
 * 
 * cdef class FlightTimedOutError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The Flight RPC call timed out."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightTimedOutError, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_11, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 225, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_8 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_11);
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, __pyx_t_7, NULL);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  __pyx_t_4 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_11, NULL);
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_4, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_4, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 225, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightTimedOutError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightTimedOutError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError)) __PYX_ERR(0, 225, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightTimedOutError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightTimedOutError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError = &__pyx_type_7pyarrow_7_flight_FlightTimedOutError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightTimedOutError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError, __pyx_vtabptr_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightTimedOutError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError) < (0)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19FlightTimedOutError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightTimedOutError___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightTimedOutError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightTimedOutError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19FlightTimedOutError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightTimedOutError___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightTimedOutError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":233
 * 
 * 
 * cdef class FlightCancelledError(FlightError, ArrowCancelled):             # <<<<<<<<<<<<<<
 *     """The operation was cancelled."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ArrowCancelled); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightCancelledError, __pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_7, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_4 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7);
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  __pyx_t_11 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_7, NULL);
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 233, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightCancelledError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightCancelledError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError)) __PYX_ERR(0, 233, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightCancelledError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightCancelledError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError = &__pyx_type_7pyarrow_7_flight_FlightCancelledError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightCancelledError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError, __pyx_vtabptr_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightCancelledError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError) < (0)) __PYX_ERR(0, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightCancelledError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightCancelledError___reduce_cy, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightCancelledError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightCancelledError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightCancelledError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightCancelledError___setstate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightCancelledError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":241
 * 
 * 
 * cdef class FlightServerError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """A server error occurred."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_11 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightServerError, __pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_8, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_11 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_8);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyObject_Call(__pyx_t_11, __pyx_t_4, NULL);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  __pyx_t_7 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_8, NULL);
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_7, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_7, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 241, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightServerError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightServerError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError)) __PYX_ERR(0, 241, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightServerError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightServerError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError = &__pyx_type_7pyarrow_7_flight_FlightServerError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightServerError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError, __pyx_vtabptr_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightServerError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightServerError) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightServerError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerError___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightServerError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightServerError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightServerError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerError___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":249
 * 
 * 
 * cdef class FlightUnauthenticatedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authenticated."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightUnauthenticatedError, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_4, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 249, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_7 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = PyNumber_Add(__pyx_t_6, __pyx_t_4);
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyObject_Call(__pyx_t_7, __pyx_t_11, NULL);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else
  #endif
  __pyx_t_8 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_4, NULL);
  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_8, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_8, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 249, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError)) __PYX_ERR(0, 249, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError = &__pyx_type_7pyarrow_7_flight_FlightUnauthenticatedError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthenticatedError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_vtabptr_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightUnauthenticatedError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError) < (0)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26FlightUnauthenticatedError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnauthenticatedError___red, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthenticatedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthenticatedError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26FlightUnauthenticatedError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnauthenticatedError___set, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthenticatedError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":257
 * 
 * 
 * cdef class FlightUnauthorizedError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The client is not authorized to perform the given operation."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_11 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightUnauthorizedError, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_11, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 257, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_8 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_11);
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyObject_Call(__pyx_t_8, __pyx_t_7, NULL);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  __pyx_t_4 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_11, NULL);
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_4, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_4, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 257, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError)) __PYX_ERR(0, 257, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightUnauthorizedError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError = &__pyx_type_7pyarrow_7_flight_FlightUnauthorizedError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnauthorizedError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_vtabptr_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightUnauthorizedError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError) < (0)) __PYX_ERR(0, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23FlightUnauthorizedError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnauthorizedError___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightUnauthorizedError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnauthorizedError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23FlightUnauthorizedError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnauthorizedError___setsta, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnauthorizedError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":265
 * 
 * 
 * cdef class FlightUnavailableError(FlightError, ArrowException):             # <<<<<<<<<<<<<<
 *     """The server is not reachable or available."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ArrowException); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError), __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_7 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_FlightUnavailableError, __pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_2 = __Pyx_PyTuple_GET_ITEM(__pyx_t_7, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_2, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 265, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_4 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7);
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_11 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else
  #endif
  __pyx_t_11 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_7, NULL);
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 265, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightUnavailableError_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError, __pyx_base.__dict__), __pyx_t_2) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightUnavailableError_spec, __pyx_t_2);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightUnavailableError_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_type_7pyarrow_7_flight_FlightUnavailableError.tp_bases = __pyx_t_2;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError = &__pyx_type_7pyarrow_7_flight_FlightUnavailableError;
  #endif
  if (sizeof(struct __pyx_obj_7pyarrow_7_flight_FlightUnavailableError) != sizeof(PyBaseExceptionObject)) {
    if (__Pyx_validate_extern_base(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  }
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightError;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError, __pyx_vtabptr_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightUnavailableError, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError) < (0)) __PYX_ERR(0, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_22FlightUnavailableError_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnavailableError___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightUnavailableError, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightUnavailableError__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_22FlightUnavailableError_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightUnavailableError___setstat, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightUnavailableError, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":273
 * 
 * 
 * class FlightWriteSizeExceededError(ArrowInvalid):             # <<<<<<<<<<<<<<
 *     """A write operation exceeded the client-configured limit."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ArrowInvalid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __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, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FlightWriteSizeExceededError, __pyx_mstate_global->__pyx_n_u_FlightWriteSizeExceededError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_A_write_operation_exceeded_the_c); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_2 != __pyx_t_7) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 273, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/_flight.pyx":276
 *     """A write operation exceeded the client-configured limit."""
 * 
 *     def __init__(self, message, limit, actual):             # <<<<<<<<<<<<<<
 *         super().__init__(message)
 *         self.limit = limit
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_28FlightWriteSizeExceededError_1__init__, 0, __pyx_mstate_global->__pyx_n_u_FlightWriteSizeExceededError___i, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  PyList_Append(__pyx_t_7, __pyx_t_6);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":273
 * 
 * 
 * class FlightWriteSizeExceededError(ArrowInvalid):             # <<<<<<<<<<<<<<
 *     """A write operation exceeded the client-configured limit."""
 * 
*/
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_FlightWriteSizeExceededError, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_6) < (0)) __PYX_ERR(0, 273, __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_FlightWriteSizeExceededError, __pyx_t_6) < (0)) __PYX_ERR(0, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":314
 *         return (<Action> action).action
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Action_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Action_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_2) < (0)) __PYX_ERR(0, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":323
 *         return GetResultValue(self.action.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Action_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Action_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_2) < (0)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Action, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Action_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Action___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.action cannot be converted to a Python object for pickling"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Action_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Action___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":344
 * 
 * 
 * _ActionType = collections.namedtuple('_ActionType', ['type', 'description'])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_namedtuple); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_type, __pyx_mstate_global->__pyx_n_u_description); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ActionType_2, __pyx_t_8};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (3-__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_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ActionType_2, __pyx_t_11) < (0)) __PYX_ERR(0, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":347
 * 
 * 
 * class ActionType(_ActionType):             # <<<<<<<<<<<<<<
 *     """A type of action that is executable on a Flight service."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ActionType_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_ActionType, __pyx_mstate_global->__pyx_n_u_ActionType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_A_type_of_action_that_is_executa); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_11 != __pyx_t_6) {
    if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 347, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":350
 *     """A type of action that is executable on a Flight service."""
 * 
 *     def make_action(self, buf):             # <<<<<<<<<<<<<<
 *         """Create an Action with this type.
 * 
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_10ActionType_1make_action, 0, __pyx_mstate_global->__pyx_n_u_ActionType_make_action, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_make_action, __pyx_t_6) < (0)) __PYX_ERR(0, 350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":347
 * 
 * 
 * class ActionType(_ActionType):             # <<<<<<<<<<<<<<
 *     """A type of action that is executable on a Flight service."""
 * 
*/
  __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ActionType, __pyx_t_11, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ActionType, __pyx_t_6) < (0)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":381
 *         return pyarrow_wrap_buffer(self.result.get().body)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Result_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_11) < (0)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":390
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Result_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Result, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Result_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Result_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":439
 *         return self.basic_auth.get().password
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def deserialize(serialized):
 *         auth = BasicAuth()
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_9BasicAuth_3deserialize, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BasicAuth_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_11 = NULL;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":446
 *         return auth
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         return GetResultValue(self.basic_auth.get().SerializeToString())
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_9BasicAuth_5serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BasicAuth_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_BasicAuth, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_8) < (0)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.basic_auth cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_9BasicAuth_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BasicAuth___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.basic_auth cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.basic_auth cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_9BasicAuth_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_BasicAuth___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":457
 * 
 * 
 * class DescriptorType(enum.Enum):             # <<<<<<<<<<<<<<
 *     """
 *     The type of a FlightDescriptor.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __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, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_DescriptorType, __pyx_mstate_global->__pyx_n_u_DescriptorType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_The_type_of_a_FlightDescriptor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_2 != __pyx_t_8) {
    if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 457, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":475
 *     """
 * 
 *     UNKNOWN = 0             # <<<<<<<<<<<<<<
 *     PATH = 1
 *     CMD = 2
*/
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_UNKNOWN, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 475, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":476
 * 
 *     UNKNOWN = 0
 *     PATH = 1             # <<<<<<<<<<<<<<
 *     CMD = 2
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_PATH, __pyx_mstate_global->__pyx_int_1) < (0)) __PYX_ERR(0, 476, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":477
 *     UNKNOWN = 0
 *     PATH = 1
 *     CMD = 2             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_CMD, __pyx_mstate_global->__pyx_int_2) < (0)) __PYX_ERR(0, 477, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":457
 * 
 * 
 * class DescriptorType(enum.Enum):             # <<<<<<<<<<<<<<
 *     """
 *     The type of a FlightDescriptor.
*/
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_DescriptorType, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DescriptorType, __pyx_t_8) < (0)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":480
 * 
 * 
 * class FlightMethod(enum.Enum):             # <<<<<<<<<<<<<<
 *     """The implemented methods in Flight."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Enum); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_FlightMethod, __pyx_mstate_global->__pyx_n_u_FlightMethod, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_The_implemented_methods_in_Fligh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_11 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 480, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":483
 *     """The implemented methods in Flight."""
 * 
 *     INVALID = 0             # <<<<<<<<<<<<<<
 *     HANDSHAKE = 1
 *     LIST_FLIGHTS = 2
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_INVALID, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 483, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":484
 * 
 *     INVALID = 0
 *     HANDSHAKE = 1             # <<<<<<<<<<<<<<
 *     LIST_FLIGHTS = 2
 *     GET_FLIGHT_INFO = 3
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_HANDSHAKE, __pyx_mstate_global->__pyx_int_1) < (0)) __PYX_ERR(0, 484, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":485
 *     INVALID = 0
 *     HANDSHAKE = 1
 *     LIST_FLIGHTS = 2             # <<<<<<<<<<<<<<
 *     GET_FLIGHT_INFO = 3
 *     GET_SCHEMA = 4
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_LIST_FLIGHTS, __pyx_mstate_global->__pyx_int_2) < (0)) __PYX_ERR(0, 485, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":486
 *     HANDSHAKE = 1
 *     LIST_FLIGHTS = 2
 *     GET_FLIGHT_INFO = 3             # <<<<<<<<<<<<<<
 *     GET_SCHEMA = 4
 *     DO_GET = 5
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_GET_FLIGHT_INFO, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(0, 486, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":487
 *     LIST_FLIGHTS = 2
 *     GET_FLIGHT_INFO = 3
 *     GET_SCHEMA = 4             # <<<<<<<<<<<<<<
 *     DO_GET = 5
 *     DO_PUT = 6
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_GET_SCHEMA, __pyx_mstate_global->__pyx_int_4) < (0)) __PYX_ERR(0, 487, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":488
 *     GET_FLIGHT_INFO = 3
 *     GET_SCHEMA = 4
 *     DO_GET = 5             # <<<<<<<<<<<<<<
 *     DO_PUT = 6
 *     DO_ACTION = 7
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_DO_GET, __pyx_mstate_global->__pyx_int_5) < (0)) __PYX_ERR(0, 488, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":489
 *     GET_SCHEMA = 4
 *     DO_GET = 5
 *     DO_PUT = 6             # <<<<<<<<<<<<<<
 *     DO_ACTION = 7
 *     LIST_ACTIONS = 8
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_DO_PUT, __pyx_mstate_global->__pyx_int_6) < (0)) __PYX_ERR(0, 489, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":490
 *     DO_GET = 5
 *     DO_PUT = 6
 *     DO_ACTION = 7             # <<<<<<<<<<<<<<
 *     LIST_ACTIONS = 8
 *     DO_EXCHANGE = 9
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_DO_ACTION, __pyx_mstate_global->__pyx_int_7) < (0)) __PYX_ERR(0, 490, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":491
 *     DO_PUT = 6
 *     DO_ACTION = 7
 *     LIST_ACTIONS = 8             # <<<<<<<<<<<<<<
 *     DO_EXCHANGE = 9
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_LIST_ACTIONS, __pyx_mstate_global->__pyx_int_8) < (0)) __PYX_ERR(0, 491, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":492
 *     DO_ACTION = 7
 *     LIST_ACTIONS = 8
 *     DO_EXCHANGE = 9             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_DO_EXCHANGE, __pyx_mstate_global->__pyx_int_9) < (0)) __PYX_ERR(0, 492, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":480
 * 
 * 
 * class FlightMethod(enum.Enum):             # <<<<<<<<<<<<<<
 *     """The implemented methods in Flight."""
 * 
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_FlightMethod, __pyx_t_11, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FlightMethod, __pyx_t_2) < (0)) __PYX_ERR(0, 480, __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_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":527
 *                         "function instead.")
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_path(*path):
 *         """Create a FlightDescriptor for a resource path."""
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_3for_path, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor_for_path, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_path, __pyx_t_11) < (0)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_6 = NULL;
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_path, __pyx_t_11) < (0)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":536
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_command(command):
 *         """Create a FlightDescriptor for an opaque command."""
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_5for_command, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor_for_command, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_command, __pyx_t_11) < (0)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_8 = NULL;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_command); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_for_command, __pyx_t_11) < (0)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":585
 *         return (<FlightDescriptor> descriptor).descriptor
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_9serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_11) < (0)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":594
 *         return GetResultValue(self.descriptor.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_11deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDescriptor, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_6) < (0)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_6) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.descriptor cannot be converted to a Python object for pickling"
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDescriptor_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDescriptor___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_6) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":625
 *         return self.c_ticket.ticket
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Ticket_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Ticket_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_6) < (0)) __PYX_ERR(0, 625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pyarrow/_flight.pyx":634
 *         return GetResultValue(self.c_ticket.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Ticket_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Ticket_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_6) < (0)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Ticket, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_ticket cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Ticket_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Ticket___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.c_ticket cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_ticket cannot be converted to a Python object for pickling"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_6Ticket_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Ticket___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":669
 *         return self.location.ToString()
 * 
 *     def equals(self, Location other):             # <<<<<<<<<<<<<<
 *         return self == other
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_5equals, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location_equals, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_equals, __pyx_t_11) < (0)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":677
 *         return self.location.Equals((<Location> other).location)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tcp(host, port):
 *         """Create a Location for a TCP-based gRPC service."""
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_9for_grpc_tcp, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location_for_grpc_tcp, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tcp, __pyx_t_11) < (0)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_6 = NULL;
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tcp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tcp, __pyx_t_11) < (0)) __PYX_ERR(0, 677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":688
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_tls(host, port):
 *         """Create a Location for a TLS-based gRPC service."""
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_11for_grpc_tls, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location_for_grpc_tls, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tls, __pyx_t_11) < (0)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_8 = NULL;
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tls); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_tls, __pyx_t_11) < (0)) __PYX_ERR(0, 688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":699
 *         return result
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def for_grpc_unix(path):
 *         """Create a Location for a domain socket-based gRPC service."""
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_13for_grpc_unix, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location_for_grpc_unix, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_unix, __pyx_t_11) < (0)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_6 = NULL;
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_unix); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_Location, __pyx_mstate_global->__pyx_n_u_for_grpc_unix, __pyx_t_11) < (0)) __PYX_ERR(0, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.location cannot be converted to a Python object for pickling"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_8Location_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Location___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":819
 *         return self.endpoint.app_metadata
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightEndpoint_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_11) < (0)) __PYX_ERR(0, 819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":828
 *         return GetResultValue(self.endpoint.SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightEndpoint_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightEndpoint, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.endpoint cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightEndpoint___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.endpoint cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.endpoint cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_14FlightEndpoint_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightEndpoint___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":878
 *         return pyarrow_wrap_schema(schema)
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12SchemaResult_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SchemaResult_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_8) < (0)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":887
 *         return GetResultValue(self.result.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12SchemaResult_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SchemaResult_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_SchemaResult, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12SchemaResult_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SchemaResult___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.result cannot be converted to a Python object for pickling"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12SchemaResult_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SchemaResult___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1022
 *         return result
 * 
 *     def serialize(self):             # <<<<<<<<<<<<<<
 *         """Get the wire-format representation of this type.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_10FlightInfo_3serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInfo_serialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo, __pyx_mstate_global->__pyx_n_u_serialize, __pyx_t_11) < (0)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1031
 *         return GetResultValue(self.info.get().SerializeToString())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def deserialize(cls, serialized):
 *         """Parse the wire-format representation of this type.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_10FlightInfo_5deserialize, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInfo_deserialize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_11) < (0)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo, __pyx_mstate_global->__pyx_n_u_deserialize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightInfo, __pyx_mstate_global->__pyx_n_u_deserialize, __pyx_t_8) < (0)) __PYX_ERR(0, 1031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.info cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_10FlightInfo_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInfo___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.info cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.info cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_10FlightInfo_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightInfo___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.chunk cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightStreamChunk_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamChunk___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.chunk cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.chunk cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17FlightStreamChunk_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamChunk___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1081
 * 
 * 
 * cdef class _MetadataRecordBatchReader(_Weakrefable, _ReadPandasMixin):             # <<<<<<<<<<<<<<
 *     """A reader for Flight streams."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ReadPandasMixin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_6 = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable), __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader, __pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_8 = __Pyx_PyTuple_GET_ITEM(__pyx_t_2, 1);
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_8)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_10 = ((PyTypeObject*)__Pyx_PyTuple_GET_ITEM(__pyx_t_8, 0));
  if (unlikely(!CYTHON_ASSUME_SAFE_MACROS && !__pyx_t_10)) __PYX_ERR(0, 1081, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  if (__Pyx_get_runtime_version() < 0x030A0000) {
    __pyx_t_6 = PyObject_GetAttrString((PyObject*)&PyType_Type, "__new__");
    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_Pack(1, (PyObject*)&PyType_Type);
    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_2);
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  __pyx_t_11 = __Pyx_PyType_GetSlot(&PyType_Type, tp_new, newfunc)(&PyType_Type, __pyx_t_2, NULL);
  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*) != __pyx_t_10) {
    __Pyx_TypeName base_name = __Pyx_PyType_GetFullyQualifiedName(__Pyx_PyType_GetSlot((PyTypeObject*) __pyx_t_11, tp_base, PyTypeObject*));
    __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(__pyx_t_10);
    PyErr_Format(PyExc_TypeError, "best base '" __Pyx_FMT_TYPENAME "' must be equal to first base '" __Pyx_FMT_TYPENAME "'",
                 base_name, type_name);
    __Pyx_DECREF_TypeName(base_name);
    __Pyx_DECREF_TypeName(type_name);
    __PYX_ERR(0, 1081, __pyx_L1_error)
  }
  __pyx_t_10 = NULL;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  #if CYTHON_USE_TYPE_SPECS
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader, __dict__), __pyx_t_8) < (0)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader_spec, __pyx_t_8);
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader)) __PYX_ERR(0, 1081, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1081, __pyx_L1_error)
  #else
  __Pyx_INCREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader.tp_bases = __pyx_t_8;
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader = &__pyx_type_7pyarrow_7_flight__MetadataRecordBatchReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_3lib__Weakrefable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1081, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader);
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1081, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight__MetadataRecordBatchReader, __pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1104
 *         return pyarrow_wrap_schema(c_schema)
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_5read_all, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader_read, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader, __pyx_mstate_global->__pyx_n_u_read_all, __pyx_t_8) < (0)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1112
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def read_chunk(self):             # <<<<<<<<<<<<<<
 *         """Read the next FlightStreamChunk along with any metadata.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_7read_chunk, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader_read_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader, __pyx_mstate_global->__pyx_n_u_read_chunk, __pyx_t_8) < (0)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1136
 *         return chunk
 * 
 *     def to_reader(self):             # <<<<<<<<<<<<<<
 *         """Convert this reader into a regular RecordBatchReader.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_9to_reader, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader_to_re, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader, __pyx_mstate_global->__pyx_n_u_to_reader, __pyx_t_8) < (0)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader___red, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_26_MetadataRecordBatchReader_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader___set, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1166
 * 
 * 
 * cdef class MetadataRecordBatchReader(_MetadataRecordBatchReader):             # <<<<<<<<<<<<<<
 *     """The base class for readers for Flight streams.
 * 
*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_8 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_base.__dict__), __pyx_t_8) < (0)) __PYX_ERR(0, 1166, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader_spec, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader)) __PYX_ERR(0, 1166, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1166, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader = &__pyx_type_7pyarrow_7_flight_MetadataRecordBatchReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__MetadataRecordBatchReader;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1166, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader);
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader_2, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1166, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_MetadataRecordBatchReader, __pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader) < (0)) __PYX_ERR(0, 1166, __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):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchReader_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader___redu, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchReader_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader___sets, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1175
 * 
 * 
 * cdef class FlightStreamReader(MetadataRecordBatchReader):             # <<<<<<<<<<<<<<
 *     """A reader that can also be canceled."""
 * 
*/
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_8 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_validate_bases_tuple(__pyx_type_7pyarrow_7_flight_FlightStreamReader_spec.name, offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader, __pyx_base.__pyx_base.__dict__), __pyx_t_8) < (0)) __PYX_ERR(0, 1175, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_7pyarrow_7_flight_FlightStreamReader_spec, __pyx_t_8);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader)) __PYX_ERR(0, 1175, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_7pyarrow_7_flight_FlightStreamReader_spec, __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader) < (0)) __PYX_ERR(0, 1175, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader = &__pyx_type_7pyarrow_7_flight_FlightStreamReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader->tp_base = __pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchReader;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader) < (0)) __PYX_ERR(0, 1175, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader);
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FlightStreamReader, (PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader) < (0)) __PYX_ERR(0, 1175, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader->tp_weaklistoffset = offsetof(struct __pyx_obj_7pyarrow_7_flight_FlightStreamReader, __pyx_base.__pyx_base.__pyx_base.__weakref__);
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader) < (0)) __PYX_ERR(0, 1175, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":1178
 *     """A reader that can also be canceled."""
 * 
 *     def cancel(self):             # <<<<<<<<<<<<<<
 *         """Cancel the read operation."""
 *         with nogil:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_1cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamReader_cancel, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader, __pyx_mstate_global->__pyx_n_u_cancel, __pyx_t_8) < (0)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1183
 *             (<CFlightStreamReader*> self.reader.get()).Cancel()
 * 
 *     def read_all(self):             # <<<<<<<<<<<<<<
 *         """Read the entire contents of the stream as a Table."""
 *         cdef:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_3read_all, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamReader_read_all, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamReader, __pyx_mstate_global->__pyx_n_u_read_all, __pyx_t_8) < (0)) __PYX_ERR(0, 1183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamReader___reduce_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamReader_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamReader___setstate_cy, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1206
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
 *     def begin(self, schema: Schema, options=None):             # <<<<<<<<<<<<<<
 *         """Prepare to write data to this stream with the given schema."""
 *         cdef:
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_schema, __pyx_mstate_global->__pyx_n_u_Schema) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_1begin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_begin, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_begin, __pyx_t_2) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1214
 *             check_flight_status(self._writer().Begin(c_schema, c_options))
 * 
 *     def write_metadata(self, buf):             # <<<<<<<<<<<<<<
 *         """Write Flight metadata by itself."""
 *         cdef shared_ptr[CBuffer] c_buf = pyarrow_unwrap_buffer(as_buffer(buf))
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_3write_metadata, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_write, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_write_metadata, __pyx_t_2) < (0)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1221
 *                 self._writer().WriteMetadata(c_buf))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_5write_batch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_write_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_write_batch, __pyx_t_2) < (0)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1242
 *                 self._writer().WriteRecordBatch(deref(batch.batch), custom_metadata))
 * 
 *     def write_table(self, Table table, max_chunksize=None, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Write Table to stream in (contiguous) RecordBatch objects.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_7write_table, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_write_3, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_write_table, __pyx_t_2) < (0)) __PYX_ERR(0, 1242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1271
 *                 self._writer().WriteTable(table.table[0], c_max_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker.
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_9close, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_close, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_close, __pyx_t_2) < (0)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1278
 *             check_flight_status(self._writer().Close())
 * 
 *     def write_with_metadata(self, RecordBatch batch, buf):             # <<<<<<<<<<<<<<
 *         """Write a RecordBatch along with Flight metadata.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_11write_with_metadata, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter_write_4, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_MetadataRecordBatchWriter, __pyx_mstate_global->__pyx_n_u_write_with_metadata, __pyx_t_2) < (0)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter___redu, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25MetadataRecordBatchWriter_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchWriter___sets, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1298
 *     """A writer that also allows closing the write side of a stream."""
 * 
 *     def done_writing(self):             # <<<<<<<<<<<<<<
 *         """Indicate that the client is done writing, but not done reading."""
 *         with nogil:
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_1done_writing, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamWriter_done_writing, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightStreamWriter, __pyx_mstate_global->__pyx_n_u_done_writing, __pyx_t_2) < (0)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamWriter___reduce_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_18FlightStreamWriter_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightStreamWriter___setstate_cy, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1311
 *         unique_ptr[CFlightMetadataReader] reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         """Read the next metadata message."""
 *         cdef shared_ptr[CBuffer] buf
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_1read, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataReader_read, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataReader, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_2) < (0)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataReader___reduce_cy, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataReader_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataReader___setstate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1327
 *         unique_ptr[CFlightMetadataWriter] writer
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         """Write the next metadata message.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_1write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataWriter_write, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightMetadataWriter, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_2) < (0)) __PYX_ERR(0, 1327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataWriter___reduce_cy, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.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_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_20FlightMetadataWriter_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightMetadataWriter___setstate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1340
 * 
 * 
 * class AsyncioCall:             # <<<<<<<<<<<<<<
 *     """State for an async RPC using asyncio."""
 * 
*/
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_AsyncioCall, __pyx_mstate_global->__pyx_n_u_AsyncioCall, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_State_for_an_async_RPC_using_asy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_flight.pyx":1343
 *     """State for an async RPC using asyncio."""
 * 
 *     def __init__(self) -> None:             # <<<<<<<<<<<<<<
 *         import asyncio
 *         self._future = asyncio.get_running_loop().create_future()
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11AsyncioCall_1__init__, 0, __pyx_mstate_global->__pyx_n_u_AsyncioCall___init, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_11) < (0)) __PYX_ERR(0, 1343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1347
 *         self._future = asyncio.get_running_loop().create_future()
 * 
 *     def as_awaitable(self) -> object:             # <<<<<<<<<<<<<<
 *         return self._future
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_object) < (0)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11AsyncioCall_3as_awaitable, 0, __pyx_mstate_global->__pyx_n_u_AsyncioCall_as_awaitable, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_as_awaitable, __pyx_t_8) < (0)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1350
 *         return self._future
 * 
 *     def wakeup(self, result_or_exception) -> None:             # <<<<<<<<<<<<<<
 *         # Mark the Future done from within its loop (asyncio
 *         # objects are generally not thread-safe)
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11AsyncioCall_5wakeup, 0, __pyx_mstate_global->__pyx_n_u_AsyncioCall_wakeup, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_wakeup, __pyx_t_11) < (0)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1340
 * 
 * 
 * class AsyncioCall:             # <<<<<<<<<<<<<<
 *     """State for an async RPC using asyncio."""
 * 
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_AsyncioCall, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AsyncioCall, __pyx_t_11) < (0)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/_flight.pyx":1379
 *         descriptor: FlightDescriptor,
 *         *,
 *         options: FlightCallOptions = None,             # <<<<<<<<<<<<<<
 *     ):
 *         call = AsyncioCall()
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_options, Py_None) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)

  /* "pyarrow/_flight.pyx":1375
 *         self._client = client
 * 
 *     async def get_flight_info(             # <<<<<<<<<<<<<<
 *         self,
 *         descriptor: FlightDescriptor,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_descriptor, __pyx_mstate_global->__pyx_n_u_FlightDescriptor) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_3get_flight_info, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_mstate_global->__pyx_n_u_AsyncioFlightClient_get_flight_i, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_2);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient, __pyx_mstate_global->__pyx_n_u_get_flight_info, __pyx_t_8) < (0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_6__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AsyncioFlightClient___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient, __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)":16
 *     else:
 *         return __pyx_unpickle_AsyncioFlightClient, (type(self), 0x82d6548, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_AsyncioFlightClient__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19AsyncioFlightClient_8__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AsyncioFlightClient___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_AsyncioFlightClient, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1505
 *         return self.client.get().supports_async()
 * 
 *     def as_async(self) -> None:             # <<<<<<<<<<<<<<
 *         check_status(self.client.get().CheckAsyncSupport())
 *         return AsyncioFlightClient(self)
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_3as_async, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_as_async, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_as_async, __pyx_t_11) < (0)) __PYX_ERR(0, 1505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1509
 *         return AsyncioFlightClient(self)
 * 
 *     def wait_for_available(self, timeout=5):             # <<<<<<<<<<<<<<
 *         """Block until the server can be contacted.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_5wait_for_available, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_wait_for_available, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_wait_for_available, __pyx_t_11) < (0)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1534
 *                 break
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_7connect, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_connect, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_11) < (0)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_connect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_8) < (0)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1553
 *         )
 * 
 *     def authenticate(self, auth_handler, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Authenticate to the server.
 * 
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_9authenticate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_authenticate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_authenticate, __pyx_t_11) < (0)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1576
 *                                                move(handler)))
 * 
 *     def authenticate_basic_token(self, username, password,             # <<<<<<<<<<<<<<
 *                                  options: FlightCallOptions = None):
 *         """Authenticate to the server with HTTP basic authentication.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_11authenticate_basic_token, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_authenticate_basic, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_authenticate_basic_token, __pyx_t_8) < (0)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1608
 *         return GetResultValue(result)
 * 
 *     def list_actions(self, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """List the actions available on a service."""
 *         cdef:
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_13list_actions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_list_actions, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_list_actions, __pyx_t_11) < (0)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1629
 *             return result
 * 
 *     def do_action(self, action, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """
 *         Execute an action on a service.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_15do_action, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_do_action, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_do_action, __pyx_t_8) < (0)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_criteria, __pyx_mstate_global->__pyx_n_u_bytes_2) < (0)) __PYX_ERR(0, 1674, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_17list_flights, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_list_flights, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_list_flights, __pyx_t_11) < (0)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1702
 *                 yield result
 * 
 *     def get_flight_info(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                         options: FlightCallOptions = None):
 *         """Request information about an available flight."""
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_descriptor, __pyx_mstate_global->__pyx_n_u_FlightDescriptor) < (0)) __PYX_ERR(0, 1702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_20get_flight_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_get_flight_info, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_get_flight_info, __pyx_t_8) < (0)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1717
 *         return result
 * 
 *     def get_schema(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                    options: FlightCallOptions = None):
 *         """Request schema for an available flight."""
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_descriptor, __pyx_mstate_global->__pyx_n_u_FlightDescriptor) < (0)) __PYX_ERR(0, 1717, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_22get_schema, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_get_schema, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_get_schema, __pyx_t_11) < (0)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1733
 *         return result
 * 
 *     def do_get(self, ticket: Ticket, options: FlightCallOptions = None):             # <<<<<<<<<<<<<<
 *         """Request the data for a flight.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ticket, __pyx_mstate_global->__pyx_n_u_Ticket) < (0)) __PYX_ERR(0, 1733, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1733, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_24do_get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_do_get, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_do_get, __pyx_t_8) < (0)) __PYX_ERR(0, 1733, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1752
 *         return result
 * 
 *     def do_put(self, descriptor: FlightDescriptor, Schema schema not None,             # <<<<<<<<<<<<<<
 *                options: FlightCallOptions = None):
 *         """Upload data to a flight.
*/
  __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_descriptor, __pyx_mstate_global->__pyx_n_u_FlightDescriptor) < (0)) __PYX_ERR(0, 1752, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_26do_put, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_do_put, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_do_put, __pyx_t_11) < (0)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1779
 *         return py_writer, py_reader
 * 
 *     def do_exchange(self, descriptor: FlightDescriptor,             # <<<<<<<<<<<<<<
 *                     options: FlightCallOptions = None):
 *         """Start a bidirectional data exchange with a server.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_descriptor, __pyx_mstate_global->__pyx_n_u_FlightDescriptor) < (0)) __PYX_ERR(0, 1779, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_n_u_FlightCallOptions) < (0)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_28do_exchange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_do_exchange, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_do_exchange, __pyx_t_8) < (0)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1811
 *         return py_writer, py_reader
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """Close the client and disconnect."""
 *         client = self.client.get()
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_30close, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient_close, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_close, __pyx_t_8) < (0)) __PYX_ERR(0, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1822
 *         self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_34__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient___enter, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_8) < (0)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1825
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_36__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient___exit, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightClient, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_8) < (0)) __PYX_ERR(0, 1825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.client cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_38__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.client cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.client cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_12FlightClient_40__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightClient___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDataStream_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDataStream___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, __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)":16
 *     else:
 *         return __pyx_unpickle_FlightDataStream, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_FlightDataStream__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightDataStream_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightDataStream___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightDataStream, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.write_options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17RecordBatchStream_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_RecordBatchStream___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.write_options cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.write_options cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17RecordBatchStream_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_RecordBatchStream___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_15GeneratorStream_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GeneratorStream___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.c_options,self.current_stream,self.schema cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_15GeneratorStream_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_GeneratorStream___setstate_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1930
 *         const CServerCallContext* context
 * 
 *     def peer_identity(self):             # <<<<<<<<<<<<<<
 *         """Get the identity of the authenticated peer.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_1peer_identity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_peer_identity, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_peer_identity, __pyx_t_8) < (0)) __PYX_ERR(0, 1930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1937
 *         return tobytes(self.context.peer_identity())
 * 
 *     def peer(self):             # <<<<<<<<<<<<<<
 *         """Get the address of the peer."""
 *         # Set safe=True as gRPC on Windows sometimes gives garbage bytes
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_3peer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_peer, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_peer, __pyx_t_8) < (0)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1942
 *         return frombytes(self.context.peer(), safe=True)
 * 
 *     def is_cancelled(self):             # <<<<<<<<<<<<<<
 *         """Check if the current RPC call has been canceled by the client."""
 *         return self.context.is_cancelled()
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_5is_cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_is_cancelled, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_is_cancelled, __pyx_t_8) < (0)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1946
 *         return self.context.is_cancelled()
 * 
 *     def add_header(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response header."""
 *         self.context.AddHeader(tobytes(key), tobytes(value))
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_7add_header, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_add_header, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_add_header, __pyx_t_8) < (0)) __PYX_ERR(0, 1946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1950
 *         self.context.AddHeader(tobytes(key), tobytes(value))
 * 
 *     def add_trailer(self, key, value):             # <<<<<<<<<<<<<<
 *         """Add a response trailer."""
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_9add_trailer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_add_trailer, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_add_trailer, __pyx_t_8) < (0)) __PYX_ERR(0, 1950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":1954
 *         self.context.AddTrailer(tobytes(key), tobytes(value))
 * 
 *     def get_middleware(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Get a middleware instance by key.
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_11get_middleware, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext_get_middleware, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerCallContext, __pyx_mstate_global->__pyx_n_u_get_middleware, __pyx_t_8) < (0)) __PYX_ERR(0, 1954, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.context cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.context cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.context cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerCallContext_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerCallContext___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":1994
 *         CServerAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_1read, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthReader_read, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthReader, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_8) < (0)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthReader___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthReader_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthReader___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":2025
 *         CServerAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_1write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthSender_write, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthSender, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_8) < (0)) __PYX_ERR(0, 2025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthSender___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerAuthSender_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthSender___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":2055
 *         CClientAuthReader* reader
 * 
 *     def read(self):             # <<<<<<<<<<<<<<
 *         cdef c_string token
 *         if not self.reader:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_1read, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthReader_read, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthReader, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_8) < (0)) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthReader___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.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_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthReader_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthReader___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":2086
 *         CClientAuthSender* sender
 * 
 *     def write(self, message):             # <<<<<<<<<<<<<<
 *         cdef c_string c_message = tobytes(message)
 *         if not self.sender:
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_1write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthSender_write, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthSender, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_8) < (0)) __PYX_ERR(0, 2086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthSender___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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.sender cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.sender cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientAuthSender_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthSender___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  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;

  /* "pyarrow/_flight.pyx":2553
 *     """
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the client.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_1authenticate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthHandler_authenticate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler, __pyx_mstate_global->__pyx_n_u_authenticate, __pyx_t_8) < (0)) __PYX_ERR(0, 2553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2567
 *         raise NotImplementedError
 * 
 *     def is_valid(self, token):             # <<<<<<<<<<<<<<
 *         """Validate a client token, returning their identity.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_3is_valid, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthHandler_is_valid, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler, __pyx_mstate_global->__pyx_n_u_is_valid, __pyx_t_8) < (0)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthHandler___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler, __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)":16
 *     else:
 *         return __pyx_unpickle_ServerAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerAuthHandler__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ServerAuthHandler_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerAuthHandler___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerAuthHandler, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2592
 *     """Authentication plugin for a client."""
 * 
 *     def authenticate(self, outgoing, incoming):             # <<<<<<<<<<<<<<
 *         """Conduct the handshake with the server.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_1authenticate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthHandler_authenticate, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler, __pyx_mstate_global->__pyx_n_u_authenticate, __pyx_t_8) < (0)) __PYX_ERR(0, 2592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2604
 *         raise NotImplementedError
 * 
 *     def get_token(self):             # <<<<<<<<<<<<<<
 *         """Get the auth token for a call."""
 *         raise NotImplementedError
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_3get_token, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthHandler_get_token, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler, __pyx_mstate_global->__pyx_n_u_get_token, __pyx_t_8) < (0)) __PYX_ERR(0, 2604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthHandler___reduce_cytho, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler, __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)":16
 *     else:
 *         return __pyx_unpickle_ClientAuthHandler, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientAuthHandler__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17ClientAuthHandler_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientAuthHandler___setstate_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientAuthHandler, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2615
 * 
 * 
 * _CallInfo = collections.namedtuple("_CallInfo", ["method"])             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_11 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_namedtuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_mstate_global->__pyx_n_u_CallInfo_2, __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CallInfo_2, __pyx_t_8) < (0)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2618
 * 
 * 
 * class CallInfo(_CallInfo):             # <<<<<<<<<<<<<<
 *     """Information about a particular RPC for Flight middleware."""
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_CallInfo_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyTuple_Pack(1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2618, __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, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_8, __pyx_mstate_global->__pyx_n_u_CallInfo, __pyx_mstate_global->__pyx_n_u_CallInfo, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_kp_u_Information_about_a_particular_R); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_8 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 2618, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CallInfo, __pyx_t_8, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CallInfo, __pyx_t_4) < (0)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2636
 *     """
 * 
 *     def start_call(self, info):             # <<<<<<<<<<<<<<
 *         """Called at the start of an RPC.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_1start_call, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddlewareFactory_start_ca, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory, __pyx_mstate_global->__pyx_n_u_start_call, __pyx_t_8) < (0)) __PYX_ERR(0, 2636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddlewareFactory___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory, __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)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddlewareFactory__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ClientMiddlewareFactory_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddlewareFactory___setsta, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddlewareFactory, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2663
 *     """
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         """A callback before headers are sent.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_1sending_headers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddleware_sending_headers, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __pyx_mstate_global->__pyx_n_u_sending_headers, __pyx_t_8) < (0)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2681
 *         """
 * 
 *     def received_headers(self, headers):             # <<<<<<<<<<<<<<
 *         """A callback when headers are received.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_3received_headers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddleware_received_header, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __pyx_mstate_global->__pyx_n_u_received_headers, __pyx_t_8) < (0)) __PYX_ERR(0, 2681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2695
 *         """
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         """A callback when the call finishes.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_5call_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddleware_call_completed, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __pyx_mstate_global->__pyx_n_u_call_completed, __pyx_t_8) < (0)) __PYX_ERR(0, 2695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddleware___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __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)":16
 *     else:
 *         return __pyx_unpickle_ClientMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ClientMiddleware__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ClientMiddleware_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ClientMiddleware___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ClientMiddleware, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2727
 *     """
 * 
 *     def start_call(self, info, headers):             # <<<<<<<<<<<<<<
 *         """Called at the start of an RPC.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_1start_call, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactory_start_ca, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory, __pyx_mstate_global->__pyx_n_u_start_call, __pyx_t_8) < (0)) __PYX_ERR(0, 2727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactory___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory, __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)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddlewareFactory__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23ServerMiddlewareFactory_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactory___setsta, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddlewareFactory, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_30TracingServerMiddlewareFactory_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TracingServerMiddlewareFactory_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[161])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory, __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)":16
 *     else:
 *         return __pyx_unpickle_TracingServerMiddlewareFactory, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_TracingServerMiddlewareFactory__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_30TracingServerMiddlewareFactory_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TracingServerMiddlewareFactory_3, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[162])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_TracingServerMiddlewareFactory, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2780
 *     """
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         """A callback before headers are sent.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_1sending_headers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddleware_sending_headers, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[163])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, __pyx_mstate_global->__pyx_n_u_sending_headers, __pyx_t_8) < (0)) __PYX_ERR(0, 2780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2798
 *         """
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         """A callback when the call finishes.
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_3call_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddleware_call_completed, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[164])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, __pyx_mstate_global->__pyx_n_u_call_completed, __pyx_t_8) < (0)) __PYX_ERR(0, 2798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddleware___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[165])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, __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)":16
 *     else:
 *         return __pyx_unpickle_ServerMiddleware, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ServerMiddleware__set_state(self, __pyx_state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16ServerMiddleware_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddleware___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[166])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2818
 * 
 * 
 * class TracingServerMiddleware(ServerMiddleware):             # <<<<<<<<<<<<<<
 *     __slots__ = ["trace_context"]
 * 
*/
  __pyx_t_8 = PyTuple_Pack(1, ((PyObject *)__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_ServerMiddleware)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2 != __pyx_t_8) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 2818, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2819
 * 
 * class TracingServerMiddleware(ServerMiddleware):
 *     __slots__ = ["trace_context"]             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, trace_context):
*/
  __pyx_t_8 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_trace_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_slots, __pyx_t_8) < (0)) __PYX_ERR(0, 2819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2821
 *     __slots__ = ["trace_context"]
 * 
 *     def __init__(self, trace_context):             # <<<<<<<<<<<<<<
 *         self.trace_context = trace_context
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23TracingServerMiddleware_1__init__, 0, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware___init, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[167])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_8) < (0)) __PYX_ERR(0, 2821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pyarrow/_flight.pyx":2818
 * 
 * 
 * class TracingServerMiddleware(ServerMiddleware):             # <<<<<<<<<<<<<<
 *     __slots__ = ["trace_context"]
 * 
*/
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TracingServerMiddleware, __pyx_t_8) < (0)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":2834
 *         self.factories = factories
 * 
 *     def start_call(self, info, headers):             # <<<<<<<<<<<<<<
 *         instances = {}
 *         for key, factory in self.factories.items():
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_3start_call, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactoryWrapper_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[168])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, __pyx_mstate_global->__pyx_n_u_start_call, __pyx_t_2) < (0)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactoryWrapper_3, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[169])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, __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)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareFactoryWrapper, (type(self), 0xe0e1e06, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareFactoryWrapper__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_31_ServerMiddlewareFactoryWrapper_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareFactoryWrapper_4, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[170])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareFactoryWrapper, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":2853
 *         self.middleware = middleware
 * 
 *     def sending_headers(self):             # <<<<<<<<<<<<<<
 *         headers = collections.defaultdict(list)
 *         for instance in self.middleware.values():
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_3sending_headers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareWrapper_sending, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[171])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_mstate_global->__pyx_n_u_sending_headers, __pyx_t_2) < (0)) __PYX_ERR(0, 2853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":2869
 *         return headers
 * 
 *     def call_completed(self, exception):             # <<<<<<<<<<<<<<
 *         for instance in self.middleware.values():
 *             instance.call_completed(exception)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_5call_completed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareWrapper_call_co, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[172])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_mstate_global->__pyx_n_u_call_completed, __pyx_t_2) < (0)) __PYX_ERR(0, 2869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareWrapper___reduc, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[173])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __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)":16
 *     else:
 *         return __pyx_unpickle__ServerMiddlewareWrapper, (type(self), 0xfd7f274, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle__ServerMiddlewareWrapper__set_state(self, __pyx_state)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_24_ServerMiddlewareWrapper_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ServerMiddlewareWrapper___setst, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[174])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__ServerMiddlewareWrapper, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":2885
 *         shared_ptr[PyFlightServer] server
 * 
 *     def finalize(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             PyFlightServer* server = self.server.get()
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_1finalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerFinalizer_finalize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[175])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight__FlightServerFinalizer, __pyx_mstate_global->__pyx_n_u_finalize, __pyx_t_2) < (0)) __PYX_ERR(0, 2885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerFinalizer___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[176])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_22_FlightServerFinalizer_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerFinalizer___setstat, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[177])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  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;

  /* "pyarrow/_flight.pyx":3044
 *         return self.server.get().port()
 * 
 *     def list_flights(self, context, criteria):             # <<<<<<<<<<<<<<
 *         """List flights available on this service.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_3list_flights, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_list_flights, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[178])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_list_flights, __pyx_t_2) < (0)) __PYX_ERR(0, 3044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":3064
 *         raise NotImplementedError
 * 
 *     def get_flight_info(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get information about a flight.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_5get_flight_info, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_get_flight_info_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[179])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_get_flight_info, __pyx_t_2) < (0)) __PYX_ERR(0, 3064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":3084
 *         raise NotImplementedError
 * 
 *     def get_schema(self, context, descriptor):             # <<<<<<<<<<<<<<
 *         """Get the schema of a flight.
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_7get_schema, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_get_schema, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[180])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_get_schema, __pyx_t_2) < (0)) __PYX_ERR(0, 3084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/_flight.pyx":3104
 *         raise NotImplementedError
 * 
 *     def do_put(self, context, descriptor, reader: MetadataRecordBatchReader,             # <<<<<<<<<<<<<<
 *                writer: FlightMetadataWriter):
 *         """Write data to a flight.
*/
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_reader, __pyx_mstate_global->__pyx_n_u_MetadataRecordBatchReader_2) < (0)) __PYX_ERR(0, 3104, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_writer, __pyx_mstate_global->__pyx_n_u_FlightMetadataWriter) < (0)) __PYX_ERR(0, 3104, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_9do_put, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_do_put, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[181])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_do_put, __pyx_t_11) < (0)) __PYX_ERR(0, 3104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3125
 *         raise NotImplementedError
 * 
 *     def do_get(self, context, ticket):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_11do_get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_do_get, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[182])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_do_get, __pyx_t_11) < (0)) __PYX_ERR(0, 3125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3146
 *         raise NotImplementedError
 * 
 *     def do_exchange(self, context, descriptor, reader, writer):             # <<<<<<<<<<<<<<
 *         """Write data to a flight.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_13do_exchange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_do_exchange, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[183])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_do_exchange, __pyx_t_11) < (0)) __PYX_ERR(0, 3146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3166
 *         raise NotImplementedError
 * 
 *     def list_actions(self, context):             # <<<<<<<<<<<<<<
 *         """List custom actions available on this server.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_15list_actions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_list_actions, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[184])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_list_actions, __pyx_t_11) < (0)) __PYX_ERR(0, 3166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3184
 *         raise NotImplementedError
 * 
 *     def do_action(self, context, action):             # <<<<<<<<<<<<<<
 *         """Execute a custom action.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_17do_action, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_do_action, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[185])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_do_action, __pyx_t_11) < (0)) __PYX_ERR(0, 3184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3206
 *         raise NotImplementedError
 * 
 *     def serve(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_19serve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_serve, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[186])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_serve, __pyx_t_11) < (0)) __PYX_ERR(0, 3206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3217
 *             check_flight_status(self.server.get().ServeWithSignals())
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         """Block until the server shuts down.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_21run, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_run, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[187])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_run, __pyx_t_11) < (0)) __PYX_ERR(0, 3217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3227
 *         self.serve()
 * 
 *     def shutdown(self):             # <<<<<<<<<<<<<<
 *         """Shut down the server, blocking until current requests finish.
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_23shutdown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_shutdown, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[188])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_shutdown, __pyx_t_11) < (0)) __PYX_ERR(0, 3227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3246
 *             check_flight_status(self.server.get().Shutdown())
 * 
 *     def wait(self):             # <<<<<<<<<<<<<<
 *         """Block until server is terminated with shutdown."""
 *         with nogil:
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_25wait, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase_wait, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[189])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_wait, __pyx_t_11) < (0)) __PYX_ERR(0, 3246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3251
 *             self.server.get().Wait()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_27__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase___enter, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[190])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_11) < (0)) __PYX_ERR(0, 3251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3254
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
 *         if self.finalizer:
 *             self.finalizer()
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_29__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase___exit, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[191])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_7pyarrow_7_flight_FlightServerBase, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_11) < (0)) __PYX_ERR(0, 3254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[192])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.server cannot be converted to a Python object for pickling"
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_16FlightServerBase_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FlightServerBase___setstate_cyth, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[193])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_11) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":3259
 * 
 * 
 * def connect(location, **kwargs):             # <<<<<<<<<<<<<<
 *     """
 *     Connect to a Flight server.
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_3connect, 0, __pyx_mstate_global->__pyx_n_u_connect, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[194])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_11) < (0)) __PYX_ERR(0, 3259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_5__pyx_unpickle_FlightError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightError, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[195])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightError, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_7__pyx_unpickle_FlightInternalError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightInternalErr, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[196])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightInternalErr, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightTimedOutError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_9__pyx_unpickle_FlightTimedOutError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightTimedOutErr, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[197])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightTimedOutErr, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_11__pyx_unpickle_FlightCancelledError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightCancelledEr, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[198])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightCancelledEr, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightServerError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_13__pyx_unpickle_FlightServerError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightServerError, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[199])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightServerError, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_15__pyx_unpickle_FlightUnauthenticatedError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthentic, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[200])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthentic, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_FlightUnauthorizedError(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_17__pyx_unpickle_FlightUnauthorizedError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthorize, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[201])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnauthorize, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_19__pyx_unpickle_FlightUnavailableError, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnavailable, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[202])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightUnavailable, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_AsyncioFlightClient(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82d6548, 0xed6f087, 0x133306f, b'_client')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_21__pyx_unpickle_AsyncioFlightClient, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AsyncioFlightClie, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[203])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_AsyncioFlightClie, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_23__pyx_unpickle_FlightDataStream, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightDataStream, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[204])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_FlightDataStream, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerAuthHandler(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_25__pyx_unpickle_ServerAuthHandler, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerAuthHandler, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[205])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerAuthHandler, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_27__pyx_unpickle_ClientAuthHandler, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientAuthHandler, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[206])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientAuthHandler, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ClientMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_29__pyx_unpickle_ClientMiddlewareFactory, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddlewareF, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[207])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddlewareF, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_31__pyx_unpickle_ClientMiddleware, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddleware, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[208])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ClientMiddleware, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddlewareFactory(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_33__pyx_unpickle_ServerMiddlewareFactory, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddlewareF, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[209])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddlewareF, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_35__pyx_unpickle_TracingServerMiddlewareFactory, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_TracingServerMidd, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[210])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_TracingServerMidd, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_ServerMiddleware(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xe3b0c44, 0xda39a3e, 0xd41d8cd, b'')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_37__pyx_unpickle_ServerMiddleware, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddleware, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[211])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_ServerMiddleware, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":1
 * cdef extern from *:             # <<<<<<<<<<<<<<
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_39__pyx_unpickle__ServerMiddlewareFactoryWrapper, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[212])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle__ServerMiddlewareWrapper(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0xfd7f274, 0x9460a52, 0xb200f06, b'middleware')
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_7pyarrow_7_flight_41__pyx_unpickle__ServerMiddlewareWrapper, 0, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware_2, NULL, __pyx_mstate_global->__pyx_n_u_pyarrow__flight, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[213])); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle__ServerMiddleware_2, __pyx_t_11) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "pyarrow/_flight.pyx":1
 * # Licensed to the Apache Software Foundation (ASF) under one             # <<<<<<<<<<<<<<
 * # or more contributor license agreements.  See the NOTICE file
 * # distributed with this work for additional information
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_11) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init pyarrow._flight", __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 pyarrow._flight");
  }
  __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 ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 439, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 209, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 674, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __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;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  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);

  /* "pyarrow/_flight.pyx":91
 *     m = _FLIGHT_SERVER_ERROR_REGEX.match(message)
 *     if m:
 *         return f'Flight RPC failed with Python exception "{m.group(2)}: {m.group(1)}"'             # <<<<<<<<<<<<<<
 *     else:
 *         return message
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "pyarrow/_flight.pyx":811
 *         if self.endpoint.expiration_time.has_value():
 *             time_since_epoch = TimePoint_to_ns(self.endpoint.expiration_time.value())
 *             return lib.scalar(time_since_epoch, timestamp("ns", "UTC"))             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_ns, __pyx_mstate_global->__pyx_n_u_UTC); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "pyarrow/_flight.pyx":1188
 *             shared_ptr[CTable] c_table
 *             CStopToken stop_token
 *         with SignalStopHandler() as stop_handler:             # <<<<<<<<<<<<<<
 *             stop_token = (<StopToken> stop_handler.stop_token).stop_token
 *             with nogil:
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "pyarrow/_flight.pyx":2946
 *         elif isinstance(location, (tuple, type(None))):
 *             if location is None:
 *                 location = ('localhost', 0)             # <<<<<<<<<<<<<<
 *             host, port = location
 *             if tls_certificates:
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_localhost, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 2946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "pyarrow/_flight.pyx":1206
 *         return <CMetadataRecordBatchWriter*> self.writer.get()
 * 
 *     def begin(self, schema: Schema, options=None):             # <<<<<<<<<<<<<<
 *         """Prepare to write data to this stream with the given schema."""
 *         cdef:
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "pyarrow/_flight.pyx":1509
 *         return AsyncioFlightClient(self)
 * 
 *     def wait_for_available(self, timeout=5):             # <<<<<<<<<<<<<<
 *         """Block until the server can be contacted.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_5); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "pyarrow/_flight.pyx":1534
 *                 break
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def connect(cls, location, tls_root_certs=None, cert_chain=None,
 *                 private_key=None, override_hostname=None,
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(5, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "pyarrow/_flight.pyx":1674
 *         return _do_action_response()
 * 
 *     def list_flights(self, criteria: bytes = None,             # <<<<<<<<<<<<<<
 *                      options: FlightCallOptions = None):
 *         """List the flights available on a service."""
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<9; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __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);
  {
    const struct { const unsigned int length: 10; } index[] = {{2},{44},{56},{55},{48},{54},{57},{75},{65},{52},{49},{44},{66},{66},{66},{66},{12},{9},{11},{46},{42},{58},{54},{76},{78},{72},{30},{41},{68},{14},{134},{101},{96},{57},{24},{25},{26},{38},{30},{179},{26},{51},{37},{120},{82},{34},{120},{259},{114},{1},{1},{2},{0},{1},{2},{1},{1},{8},{14},{49},{4},{7},{8},{12},{7},{6},{11},{29},{17},{2},{9},{34},{9},{66},{11},{9},{21},{19},{28},{35},{42},{38},{37},{41},{38},{34},{25},{29},{37},{30},{15},{39},{99},{63},{67},{98},{65},{62},{63},{64},{67},{65},{61},{65},{46},{64},{63},{63},{63},{63},{70},{63},{44},{13},{15},{15},{16},{16},{6},{10},{11},{22},{24},{26},{18},{16},{14},{14},{12},{11},{20},{24},{18},{19},{37},{39},{35},{9},{27},{29},{21},{19},{3},{8},{9},{12},{11},{17},{35},{37},{30},{27},{16},{34},{36},{21},{16},{34},{36},{22},{16},{23},{41},{43},{34},{34},{36},{31},{33},{32},{6},{9},{11},{6},{6},{14},{4},{26},{5},{17},{35},{37},{20},{38},{40},{12},{22},{21},{30},{32},{21},{25},{37},{18},{20},{22},{24},{19},{19},{28},{23},{25},{25},{31},{16},{34},{36},{16},{34},{36},{28},{28},{25},{26},{14},{32},{34},{26},{24},{11},{29},{31},{10},{28},{30},{22},{20},{19},{37},{39},{20},{38},{40},{25},{20},{38},{40},{26},{12},{16},{26},{25},{34},{36},{26},{28},{23},{23},{32},{27},{29},{29},{20},{22},{25},{21},{17},{35},{37},{22},{40},{42},{31},{17},{35},{37},{18},{36},{38},{25},{27},{18},{36},{38},{31},{19},{37},{39},{26},{44},{46},{23},{41},{43},{22},{40},{42},{28},{37},{15},{10},{15},{33},{35},{9},{7},{12},{12},{8},{26},{28},{15},{21},{21},{22},{26},{25},{44},{43},{46},{45},{35},{37},{36},{25},{43},{45},{31},{31},{40},{37},{37},{45},{4},{14},{4},{20},{16},{17},{35},{37},{6},{24},{26},{18},{16},{6},{12},{30},{32},{24},{22},{17},{35},{37},{30},{26},{16},{34},{36},{21},{16},{34},{36},{22},{17},{35},{37},{28},{29},{32},{30},{22},{31},{16},{23},{31},{42},{49},{51},{41},{43},{34},{24},{42},{44},{39},{40},{34},{36},{31},{32},{17},{5},{6},{24},{26},{18},{16},{15},{23},{30},{48},{50},{32},{4},{7},{3},{6},{11},{6},{10},{11},{12},{6},{8},{12},{9},{5},{7},{18},{4},{12},{12},{24},{9},{5},{5},{4},{3},{5},{8},{5},{10},{12},{20},{15},{6},{15},{9},{12},{9},{6},{6},{8},{7},{15},{4},{14},{20},{6},{4},{4},{10},{5},{9},{9},{17},{6},{18},{5},{3},{11},{7},{7},{7},{7},{13},{8},{15},{4},{11},{8},{6},{11},{11},{10},{15},{11},{8},{5},{27},{9},{38},{19},{11},{6},{6},{7},{12},{6},{8},{9},{8},{9},{4},{6},{8},{9},{9},{8},{15},{6},{10},{9},{7},{8},{11},{12},{12},{13},{8},{9},{8},{7},{9},{15},{3},{15},{26},{8},{14},{16},{10},{9},{12},{5},{7},{7},{4},{8},{4},{8},{8},{9},{12},{13},{8},{5},{3},{6},{3},{5},{12},{12},{7},{9},{8},{9},{4},{5},{1},{8},{11},{5},{13},{7},{13},{6},{10},{10},{12},{15},{3},{24},{8},{10},{7},{4},{2},{6},{7},{7},{5},{8},{17},{1},{4},{8},{4},{4},{13},{3},{4},{11},{11},{2},{9},{13},{9},{9},{15},{11},{11},{14},{12},{11},{10},{34},{32},{31},{38},{35},{31},{26},{34},{32},{34},{41},{38},{37},{32},{31},{38},{45},{46},{39},{14},{12},{2},{4},{8},{10},{12},{6},{16},{10},{17},{13},{6},{19},{7},{6},{17},{3},{4},{6},{6},{4},{4},{15},{9},{10},{5},{6},{13},{12},{10},{10},{12},{19},{8},{4},{5},{9},{10},{5},{12},{6},{12},{10},{5},{5},{8},{5},{6},{4},{7},{9},{16},{14},{9},{7},{5},{11},{13},{13},{9},{4},{6},{3},{12},{4},{8},{5},{6},{13},{4},{18},{6},{4},{8},{7},{7},{5},{11},{14},{13},{22},{11},{19},{6},{723},{0},{11},{100},{11},{15},{11},{79},{84},{91},{11},{11},{123},{11},{2},{33},{11},{42},{42},{16},{45},{47},{48},{49},{77},{74},{20},{9},{89},{90},{90},{92},{90},{90},{90},{89},{92},{41},{51},{43},{23},{23},{162},{106},{24},{10},{20},{20},{20},{24},{22},{20},{24},{53},{27},{74},{49},{40},{40},{137},{33},{40},{9},{9},{9},{7},{9},{9},{9},{9},{84},{46},{37},{66},{58},{50},{7},{61},{42},{52},{25},{32},{22},{18},{13},{11},{17},{19},{49},{42},{23},{44},{88},{16},{24},{10},{87},{9},{141},{65},{11},{98},{100},{100},{12},{2},{11},{126},{12},{11},{59},{59},{59},{59},{58},{59},{58},{59},{58},{55},{58},{52},{11}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (6900 bytes) */
const char* const cstring = "(\265/\375`5UU\327\000\312\277@(H\340\320\272\0010\314\3634\314\216k\021\006a`v\314\216\3311;f\307l\206`\237\245\354!S\262I\266\033\n\033\245\244\311\311Y\204\364?\240=5\262\276i>\030@x|\016\225\024\256OJ4!\251`\2335\276\315m\0045\002C\002\244\002~\213\027\0041\207\024\313\211\205\305\243\344\340d\262\340\336\336v?\326\262\367\"\346x\2078\317\223E\257i9\240\210k\265\375\211Z\226\301\024\035\212.!Zh\036\027\353<\006\346\331\210\267-Z\221&\247\206\006\004\215\210\224\2365\367\336\363HY\217\313\203k\271c\213\262\240JM\300\267\177\270\327t\027I\236\022I\231M\3350n\334(0\363\021,\211\231\006Km\335\311O\304u\234_\260\236\373\016\277\232\020\277\344\235\3145hK%\237\273\355;\213\226\3348+\223\261\251.j\037\352\236{\217\221\335f\256\202A%\305\246ec\305\017\027\346\230\0163\330\222\375\246\t\361\221F\315\277\016\356\2102\251\032\311\361H\356\030\256\361U\252k\034~\031\254\365\274Aks\337\264\233\365\033\006\3455\013\035b\355\265\2501\317b\206\261+\2769\317+\237]l\352\024!e\262\253<\303\335\201\245y\234\r\230C\215e\266\305\346fei^\337\254\216H\322Z6\364\336u\350C\262\347\233\027\256e\332\327\255\314\226\211\372\312.\366\330ev7\230\312\035{\300\266g\035\354\355\212\330\036kZ\374\236YO\306`\226\333\025\230\375\227G\236\226\207\365\242\336#(\266lh\267\213\230_8\305E\034\343\311my\006q\276\241y\322\353dms\231\255\341\314\375\313\177d)E\373<\366\000\362\375\345\033\213w\210\255\310I\237\371\2668\276\375\207_2\307\267\034\202\240\016\301\363\353\303\034f3\250w6\037-.\024q\213\317:\237\366\275\317XQc\337\277\035r\034\342\3575\326`\271\246\375\325c\311\372-ZT\317\036\027\303\330c\020\373\\\273\343\210m\215\234q/\207#\351-j&j\356\273E\345O\304\276\333\034\263\276\2235]\323!'gZ&\356/\305\213Y\207\237\315`\006s\3760\317\243\327\374\226?\275\303s\267\330\3460\206=\371e\236l\273\266\036\323\274\025\267\366\037\266\262m\363\210\363\326Ky\332L\207/V\3246w\322\362-\263\270\254cA\021\333\354\361\247e\332\363\374\331\327\014\314zv\025\371&\342:\317\235\324\234\004Gr\373\356id\357\235\374\264""\337\341\230s\330/\330\373\365{\363~y\362\315|'\213d\215\354:_\276\337\250q\343m\334\321c\346\343\275\343\036\271\306\343\230A\275\263\367lw\321\363\3342\230kX\274w$kw\3267\017Ip_}k<\337v\330c:\3543\035\\\326\351\267\213z\234\211\"\311\307\275\357\305}x\226\303\253g\342\305\365\254e<\2235\262\213\371\313\343M\261\364\035nH\335{\357\365\237\006\261\014\004\301\374q\262\266}'3'=)\313<\334_\017\277,\326\356\275W\324\230\347,\303\235\266\373\367}\236\357\357\353\233\346\311\361\336\017\353\357~\337\375\356\355Y\324\236\334)\255\277.\223\221\261\334\002\023\221\311q\373W\210\305\231\346y\0341\317\2718\017\352\233\307/\324\230{\020\267\334\256E\315\243Ct\014\212\330\346\312\362\215\347\3114\327\177\332\205\007gs\257\214\3374Y\33441Q\317r\214\337\355/\217\026\311\361\363\367\033\371\254\207\230\264\345\327\013\366\222\231q\221\231\361phdZ \274\230\227\213\027\242\025\323\362\252y\241\221i\275Xh\276E\021d\rx\263\270\301\020\177\262\024\027\365\013\311\301\234\020\241\0175\336\301\327\223c\236\345\231\210i\037O\336\340\365\232\347^\236ykD\013\246usojnnZ\367\246\205s\323z]X\014\214\314\314\313\255\221b\013&\302\006\326\202i\301\320x1-#Z452\260\026\357\326\270\314\314x\260\032\227\013\346\035\235\367wS\327s1\353l\3175\266\301e\020w$o\032\337\360\355\330k\2019\014[2\350\261\357>\367{\277\233?\022\274)|\263\016\256\245.\313z`\177\232a.\2639sobu\316\272!\366\267\rz\222\246\363\341\230\250y\366\365b\346\234D}7\026\216\330\343\224,T\361\002\325\342\246T\340\302^\332\366d\032\367\365`\001k_\r\213\374\323\254\r<\270\361J`9a\023\353\306\0023\013\243\260U\241\002\354Z[V\247\331o\306B}\243\214\315\254\236\305\3345\310b9\231X8p\307b)%\332e\345;\267\017e\014\007\206\241\017D'\211\251\323\003R:\225\254\030\0059S\247w\306\204\344\244@\361Q\340|\r:\230\234*\347U\016\272\225\021\027\024e\333\345\340\374\233\016\204\247\202T\014\030G\304\237\3514\344`T\225\352\323\025o\007{}\030\235\202\\I\025\251\260\324\302kW\202\304'q\363[\3448TT\r\252\025\335\200\334\210K\252\"\262\371#:\035\365f\222R\370""\3508t&\\\351(U\331\312\221\262@\307(\247gG\006\007\010e\276\224\252\022\246'\004Z\275\236\217\000\345\213\014\227:K+\244\036\3450\371\260\245D\276HhU\225\020\204\254\267r$=q1\025\224\255\236\020\311\313\031\310\261\2448h\000\324\345$e\345Fi!\000V7\324Xz\300\226\256\234\374\322G\316\203\352\207T\004\237\363e>0\301\362\026\022\240\261\340B\351t \262\3402=U\351=\031$\323\303\266\346F\271O\256\003\312'\2414f\004\224\204\232N\007\242_@\200\306\010\3476r\253\207\252\320\323):I\241\325C\200\006\310\014O\206*\207\243z\352\006\007\004\376\311\3670\322\221\000\364=\0316UDu\231\263\t\245\325S\025\244\237\024w\342\363\203\271\200@\031\022\332\251t$\235Hw\341\304I\341\364&\307\203\220\265@\272\000=a\226\210VWy \264z\247\314d\360\3211\343\243b0\371&\240\177A\225\245$\025\204\200\212P\035\323\203\031\263\303&\203s\304d1!\264\312\003\252\322\300I:_\314\005\241\225d\366r\203\3554}h$\000}\333\316\245\356\2448M9\303RDe\220rT\005\2059A\347\356\203\332\316\222e\205V\225\t\3658I\037\256\324\002i%\241\021Bv\005D\032\0333\016\214v\007F\330\3340IF\006B\326\221\201\025\237%&\254\364>B\253\200\216U\324b\222\245J9\022\240\0212C\204\236@_\245\342\244^\252\202{\010\010\3200\231A2\262~\221z!%\245\024\274T\225V\220\260\272\322\035\024\243%'7UL\230r\024\262\332\314\006\241\025\344cU\345\006\250,\024e\344\337\224;=\004:\326\327\315\277q}\230\316\323\315\204\254*\363T\026\010\255\0374e\212L\026=*=\003:v\256\234\227\313QY>4Hf\340\334\013\205O\001\364?\352I*JU\240\365#\343\212$\251\241\321o\205\273rM\246\023kY<l\340~\274`\346\230\326W+\320w\215S\277Y\255V+k\212P\203\263\271\311p8\335Hm\250\204\023\235\205\027\021\372AON\007\035\277\003\305\211/\352hV>\317Y\"\351hN\254\2414Q\342\323\350f.|Wj\341D\323>\255\304/\301\372#\320\024\020]\214\312\2179M2\316\307\321\360I\352\n\003\212\"\002\366\305\334K\205\377\000\253\370*2\374S\347\237\203\037\364\360U\222jJ)\330\306?z\237\244\212T\240\365\213\375\030\354\303V\031\314\225\322\005h\325\311iP\007|\320\356##E\312\231\324\225\264B\203\257*\001\375\323\247\207""\301\210]\216\3157\221\233\215\324\014\033F\354n\212\237\"\347\203\320\345\200r\0354xQ\t\353\001\021\241!\314]\310W\241(\"?\003\350\207\010\320$\024\201>1\023P\370\234\035\0371\244\251W%J\217\207M'\313\311N\234;\246\355c\222\320P\324\371`\301\n\372\242\035\251\347\026B\340\014m\350\t\005\320\370\304\274\230\242/\3720\022I\375T\311/\031Ym'\003\027\022\224\205iUiFMP\021\347\210\025\221\024 ><&\242\224\345\304\200\313\033\270S\266\224$\313\304p\2120)\230\336\313eP\263\r\225\340\000\245\366T%\205AA\250I\344\221\312\216\325\222\rU\216\224\023\345.\250\005T\022\002 \033N\027\256s\227\246\213\024\324\272`M\331r\"\245\225m\203\304\232\n:h'mf6p\241\214V\216\003XE\245\241\314l\000\242\341\201z\250h\236r2*\311\340\257\"\335G\207SO?\202\000\r\221\235\013\213\214u\200t&\010a\225%\302j\262'& \243\004$\034\n\326P\031\242\232<Tvn\344\224\243\026&\227:\"\306H):OF\177\204S\221]\001\022R\010b\256\230\235\256\023\002\002\021u\241)\013\276\312\304)g\030\030\270\314\235\222\243\014\t\355>\026N\034\263d\264z\246\001\363\302\007\305!(\037\224+)(\035Aa'\204\020.?\270J\031\221\3711q=7=\037j\t\031\352\001\2159\205V\021\312CQ\240O\001\202M\345\220\362s\255\n\277\000\212\014Q\316\223\360o\320\021\352RY(\377t\372\245\023\204\321\023\262\303\245\313e\226\204~M9\362N\325\t\023\262\216\364\312f\212\230\337\316\205Y\242\014P\212D!\017>\006\214\336N\020&\310\234A\211`\340c\225\266\202\372S\344\204\331U\245jh\360\033\330\006\234,]\202\034\213te\301G\360\021\0308?\363\200\211\340\003\253.\030'\217\002\023\200\311\242\231\241\0336\023\204+\007\r\207\252\250\003\231\202\"\205J\315\214H\222$i\016s@ X\310\360h2\030\315\271\271\007\223\343\361d\032\211b,\204A\014\306D\206(B\204Df\204D\222\244\2409\227@\034T\026\207W\223\346\300\275\373\235\004\232\251\362\244\266\010\362\004\310\245N3h\013\214\355\203vm\t\213\360q\305\003\351\255\317\200Fq\027\357>\225$'\177\033\374\355u\014Ity\234\256wM\275K\370\010bS\251\341^G5I\267\372\3064(C\246\264X\251\337\234\302\005\251\367\027i\001J\"\364\214w\345<J\226d3<\030\352""\321\270\353G\036\365R|\016\243\214+I\351Q\376\021\257G\232#\254\314\233\222\333\370\313q2\337\007\0372\252U\202\0200H\233-\322\022\243k\367\025\271\004Z\243\212\201\312\244\343!\372\031\202\036\311t\001\276\2732~\214\032\342\006]L\211\031\1778\010[\272XDvdjl\213N\322gG\246]\334M\001\302\375\224\273P\302\327\001\327zu\253\200~mX\325K\300h#Q\025\007\327m\275\026\021\227?\322\036ym\226\305\272t\035@\330\267\242\324\344\351E\025\274'*\364\031-\212\307\271A\251\235\027Ac\240\005~\024\024\254n\317\321\036\030x\354\335\320\374}\323\333\001P\022\007\374\373\346\331\306\225\234;\005\217\330\017\233,^\370\345w!\321U\235\313]\242x\225\350\013\367t\031\021Qp\333\335,\236j%\332\347UCvEL\244\227J@\2678\364S\226\225\177\t\017\275vv\001\327\217]\325\371\310\202\277\312ls\"\356\231G41\017\203\224%C\031u\007\"\271\337@\317Y5o\376\377\262\371\261\035\311I\271\232\004-\307\3379\246\273\234\304\330\300\323\031\206K\305\346&\242w\342\374\033\211\272\217\212\361\243\000\371gqv?\321\363\023\326\2618P\267\203\377/q-AO4I^@\212\325\010\332L,\307\370\220\324\227]\210\253y\314\013\202\226\rZ\005\210.\"~\364\235c\207\210'(^\272\252&\233\027.\246\024>'}\321\032H\220\263\347\314SP\234*\235\302\013e\250\254\215\332x\300\276\260]\234\230*#\310\342a\323\2756\331\036!\374\227S \022WGR\315\352h\340=\316\242`\316\366\035\031;E-\315\n\243T\317\356\350z\276H\327\"\237&\337Cd\203\007\247\223\224\271\212\321\357\214\366\013\"8L\320v\260\220^I\236\305\201{\010\265\215\324\363G\026\013\003\317\240\353p\205\361wc\232-\234\007\3104bF\210/\217s\372\254\331\033\345\257\321\262\354\247\035-~D9\312F\310\201O\277\275F\325\307\026v5#\336\256?\215\266\027\037\205`\322y\3049gi\270\013\305$\354.7\277\225\322\255\257\330\337W\026\204bQ: z'\245\036\352]\004\271\372*\204\350\030n1\003Z\243[\3532\n6\356\037fX\353(\320\0218M\026\271uq/\375\257nV\315\353\200\320\214C\363$S\350\216\307E\373\244\363\354\003\200\233\364\010\"HyS\313J\002\030D[\376\247\003o\257\027\255!\000\036ji\234\310f/\310\342\026\000P\276hpL\362&\010\327""\367\305\276I\202\221\322\357\023\257\321 \027\021\261\266\006G\271pF\363T\270\023]u\017B\347\333\330\327\256N\213\343\302\353\356\350\357\006i\"b\037o\346v\3505e\252\233:\351\330n\323\036r\232&\210E\365{\023\230\2248\237\352\340I{S\216\022M\255\205\210\332\024'=\345>\227=\3312@\331\304,ed\320O\375\0005\271\031sn\250PO%\301\366\231|iEV\377\2360\375\276Z\3023x\201U\254\001$\027\361\010\3313o\214\017q\022\034\225w\03236\024$\310f\374\261\227\3762PdL}\341}i|\320j\004\336\352\244T\327\004\322\2158\014\2015c\230\331k:\350\032\014@\310'\272\314e\371\375\"p@\263\333\351$\317\033\177W\215t\327\355\367`\212\253l)\303\255\276\264\321\"\242,H\220\276\034^\352\333\221l\372\266\241<\0137\362`H\332\242\252%\267s\325\201\240\253\300\213\253*O\013\200\326\244zI]\310 \026\231\024\020\204\261\256\032\221\246\352:j<\344\025\360\322\313\330o$\260\363\317\315\223\327\3629\233\251\233;\307X\346\"2u\367n\2715\240\342\256\001~\260!ZY\212r\326jbO\031j|v)\264\020\274\360\341\342\330vJ\332oi\272\225\214\217\335\377\361\005o\000Z\026\251\212\265\211\375\354\265\0233\246\r\326\372\216TG\2555H\265\222\377<\037\341\203\004\350\206hy\216p\201&\314w\030C\004\367b`?\245\tL\271\020\322\240\207\372\237\003\300\367\320\353D\024\252H\367\260W\317\243\316\322\264p\301\325\rR\321F(\314\333J-\253\2108@\037U\216\264\242V\317'jz\213[\250oye\373\020\223\226W\017Vj\013\376\274\00731\002\352\304C\354\226\370\3401\221\001\207g\202b3\360t\367\341\267|u\227\021\025\240\327\302\034\366\347Hz+\006\211\324N\314}C,\004\320m\216\027\277\\\361\354t\232\335X\240\367\007\025\206NQ\252U\246\310\372Z\253\262\367\177\014\244\034\252\036M\032\302o\021\324s\002\226\2608\240\203N\021\207\330\006a\215\221\360\272\350\030\030\316\206\2569\214\021\n\036\t\356\253m=_\316\231\346\375\002Z\t\221\376C\002\355y\365\022\246*!\344\327\250\226\266H\000\024\0228\213\030\250\262d\364O\244\256\353\353He\233\347\376\373\000\035g\204mP&J\334\303v\006\273\016\372h\036\265!\234\365\255\323\350\365M\0233\322.)\344\002\025\372\236\\\t\\\2213\322""\324\247:\010\246Pt\017\264\202$\236;\024\353\2369X\347!y\246e\336L\211\240=Kg\005\272\241\206\225(\363Y\345u\016`\235V\256\377:L\307 \301\332\343i\035\266Wtu\031~i\004g\200\332@\037 \335$\346\002fB\010J\213\027\002\255\241?[t\320\n[U<rs{\r&5E~\350l-\266\355\370c\366lA>U\353\034\204\376\023\317\362\324/\224X\032I\313\312\301itX\206\260F\233%\343\350\3423\222\353\342\377\034\211\345\201o\201\021\205\264#9j\\\016J\363\344\316\002\021\\\234\237\306\2177s\241\331+\312~\262\245I]\246\215o\222)\326\250T\321\320$u\212b\027$-\203\313$\306\2141\330\014\001\300\234\tI\020u\254\205\006W\313\037jh\004\257\024e\010\023\341\232\347\307\351\2229\373\356\"\301pC\334\276%\n\253\350p\327,\267w_\242+PM\247\250\320\360\360r\020\357\023\370m\235b\003R\364\333`\013\335\316\206\024,\372\010\237B\014\010\245\213\200\266\270\2242\342\332\240y\024;\341%+\213[d\354(\205\2765\313\3018\010H~\354D\312\321d\"i\215\272\237y\2749\223\370Pjp\2630\325\263\n\330\300\307\205\352\200\030\016\253,vo\002\237\332\211\000oD\032\350w\323m@X\346\004\206\260\245\347\\:\\\004\355\020F\321\333g\357\032\241\374?\243Hmm5\211\363\004\322\216M\311\277\241\024\022\370\215[\354\010\017Iq\231\355\3021T\213O#7J\217V\005\222\010\264\321u\214\220\354\035\325@\2629\3608t\037a\300\020R\274\252t)S\317\2719n\230#\267D\266\271\375\241\031(\267\010\\|l/{\342R\330]6\022\177\031\2031\2579\226\270\220-v\237)\260\311Der\365\014\303\201\245\tn\365\0303*T\035#\t!\026\217\324\021\347l\334\n\356\360\363\356W\340<\242\364\227\341\2227,\327p\201\223k\312}\020\026\216S\013!5\343\024\2310'\232\024\216\350n\344O\213\253w\362\\7R\017\312\374\031\255\337\\\016\320\367z\212EIa\356~\371~>^\343\221>7B4D\264jx&\035\224>\247\342\324\370\264^\000\027\364\232Q($\\\006s\264\375\216\346\002\t\211\021+\371\016\337\231\343\221hf`Tx\003\237\227\246\273y\223D\275\005\320mb\032|\025\002\227\374$\206\206\202\345\255\"^m\232F\270\332n\007\316\243\036\350\256\311\265P\341\246\035\004\"\022'\240\037\030\0071\265S\235\374(\224\026\213\364;\353\232\034<\320\002""\203\025\362r\262\006=k\215\221\361';l\340PP$!\010a\371\277\331\"\031\221o\204\245d?.r\245\231\301\252%\367r\213c\027\201q\222D\365`\024\026\356\242\230$\375M\352\277\036\0214\026\322\354^\244,\nr\214@\010ET\004&\325\216(%\345%`\206\313\214\272!\333\265\253+\342%\020\223\026;\031\001cAv\013Z\254\353O\325\2633~\312\254\\\365\275\003\201\3302i0\242\310T\320\341\240x\242B\376\021\226o\244@`\030\245\212\276$qJ}0\032*\251\240\030\030z\024g\034\352&\027\037\223\353\032\321\353.\306s\3705\204A\342\242\345\272\007i\237\363(C\215\330\334\367={]\375\221\317\345\377\276\213\024\340U\273\000\364\332\3626\r\035Q)/E\001\264\202\001\324\362\302*sRB6dl\323)n$\206\242-\031\236\310K\335F4\231\263J\367n\315\303\335\344\210\"\036f#\361\302PI\023G\345.B\325\033\343V\020\224(\250-\005\247\271U\001A\005\035\274\203\214\261\264v\370(\254\256\204K\277\230\276Y\361\353e}\271\215\275\222\212\226\213l\255pn\340K\323\342:\232\2714\023\315\275\021\341\345\345\035-\027\2431\304\033\277\335\254\220\374\207\351Y\364\251ecf\275\033!\333\365\032K\271\236>\323\204\001\262Jk\351\025\305\205X\330\231!s\204\316\335S\r\201:\220\213@\010\357\212\214&G\336{\233\033\236S\340\304+\221n.\367k\254\3430\352\303\341\016*\357\375\346\276\005\177\215\261\014\312\364\037N\363\264\036p\217\227\353\010\270e\310\346F\330\350t\037\263\017\260\023\201\375MQ\230\301D\034\031):v8\247h_.\360\303\207&,\365\224>J\215\360>\327\365\365\023\326+\237\246\002 \334s?\330\260b\245\312!\335\303[\226\347\033\330\250\217|d\177.a~\340\205n\007\2305X\001Q\005\270x\212)R\372X\340\374\211\004\201\257&\236\305\250\272\006{\261O2\205\363\365\343[\t\357|\332\362\006j\377}\026\312e\211L\2471\006\365\005\3276]\n|\205;\360\306T\251\324\2621\313)\242\031\275\225\021\000\351\3458\204\205\275\210\263\326\253\256\244\r\300K\265^\000X\223\3617L\024\360\225\250\307\0232\345\033\222:\350$Wf\340(\253=\030\031\234\030\331\240\342dCp\227\302\350\3322\260\"\316\222\236\333\230\204-\023\036\250511e\306G\302\201\320\333\205\370\312.\303\224v\367MRWO\201Z""\014`\"\217\361\205.8X6\244\300\355\234\211\3729M-\017*\307\022/3R\206\315\021\2271use\253r\267\253\013\271)x0\205\310\327l\034\004\210A\224\336\347C\022\025\223\331w\201\267\251\256M\266KB\243;\312\257U+\3239\252\245uI\325\247\302\232\251@S\223\200E\343\325\005\352\251*U\332\334A\324<e_C\244\276\270\307\364Q\321l\" \270\014\313\214\304\003\250\377\036\272)\223\323\225\205\n\211\334\317\021r\305qlz\016\350\347\376\256$p\316\341/ \013\304\256\222\035C\220\362\271\003\tJ\207:\241\330C\217-\317\347lD\316\023\002\023{\022c\302&\342k\210H\321Pf;oI\304\023|\334V$\244\261\252\364\207\230\224XDc\356\302\010\3058\"\220\343*\337\013\233\327\027\311\025\025\244\321<Rl\356\020e\010\254U\003q\265\2763\2537\336\272\3013\023\201\003\016\026\277\0261\\5G_%5\331\347\341p$]\345\232\023\334\246$\311O\246\227\200\200\232\321\310\026_o\006\232'\021\301\232\026\330H\273\226\020T\272\247`\343\007\220\203e\253E\324\\\007\360\3554\341\377\3071\246;h\270\027\035\255)\201\352M\241\033\240\341dus\344\320*\255\271R+H\205\223{K\326\000\363\275\321\272?\276\227=\302\013\342I\343\315>\253C\320\023\266\n\025\231\224\"_\205\\\n\357\366B\354\275T\005\244\377\031\267@e8{C@\327t\277h6\033\323\276\216\217\007\r\316\037n]\324\2014\2330>\3745\224u\321\034z$\370\"\254\332\224Q\376\247\337\264\004\256J\017\233I_\270\342\3022F\243\263\354$RZ\371\252\340V\255w!\r<\370n\251\204\357\216\340P\200/\323\0135\341\205j\034j\370l\212Y?\020\327\023\351\005R\352\250|@\232\362\225&\226\216\244\207r\025\033\347\000\214;Z\304\021=\272\266\341\327ytR\332\302t\232\031\355\273\263\207\263 \336\037SU[\033\202\334\272\002?\270\307\270\316\006<!\002\236A\342\027\365\222@5hli\365]\322\316.\"\210\0351\332\016-Z0\206\333\030\222\245G\002\323,\244\277\323\006=\243\001%\233\244\365\316pU\205\031%\251\033\306Q\322\244\020[)[h\225\271\337\266\r\217(*M\206%\341\250_\253#2;\026a\035P\304H\350\364:\014\350\207\002=*Qv#\327\271\372oV<\033\302\253\214\224&\020\301nj\256AP\351\034\274\341\2179\343\322\365\013\362\320O\220G\213\205\277\331Y""\354\270(\242\302z\017\361\236\3115J\371\306\342\006\036\365\247U`\275F\2732\026\350\330`\306\236Z|$\274<\305\023PL.\206>\241[F\2706\231\374~\317\021(j\202b\254\n7\031H\376Y\004\277\320\366\325\331\000B\366\214>z\275\242\360\306\301\373\022\240\035Nol\006P\336\330KJ\245\322\364\210\376\355_\324\335\244%\263\345\312!\200\336c\030\210\367&\223\345+U-\307\225\251^\337\265\213{\310\245\364\021\202#\2165\313\224\267\344\006\265\251\021\347\0218`\341e\253\023\352\271\221\230\336>Xj\247\021\256y\266M\347yl\252m8M\313\261U\016\216\301\244\361#\272\210\031Uh\357\315[\300e\377\021(\356/+\315!]j\177\031\330o\204L\326\373\273\n\340{\201a\244\360\213\231W\356\020[\337\341\316y\213\202\276\356\204\203\303\034\216\310\222\233\342\355H\351J6Fg\000w\277\3350lW\340\263a\003\026t*\300\r\324\374A\363\215\240\020t\027\256\271\345\307\023]\375\007\010\310<N0\246w\307\224,\270\267\006\361~\361B\"\216-\244XL\202\251\342\321\037{!4\357&\271\236j\304N:\375\033\020\377\203\364\223|\303\235\241\016\224\210t@G\t\342\336\3043i\330\304\250\332\333E\007O\335\022\200\315 j\t\n\177\212\214\325\342\364U\244\220%\0330\371w\333\225\265\262\t_!~\\E2rO\367\307s\315\r\373o\034\313\320O\000\240\023\216O\007\213jq\2036$`\337\375_\276\347U\340\314\002\037\2274x\031\222\204\316\222\224\320\372*X\231\035\215O\216\210\261r\\rn=?1\345\334\001\241\331\243\314\264\353\035\340\206uCu\000\003\031\252k\246O\375\244\362tZ\200b=\006\262\315\007r\004\301\342\213n`v\303\3615OS\251#\264\006eH\366xl\252k\366fb\300\211 cL\354</\324\237L\301\225\213`\320K\365\254\321\375\"\320\017\343\024\317\010S\264\247@\014\004\016\220\331\315\243\331\370\033\021\367\231[\0251%\205\302\315U\261\035\331\025\250\030F\366\025p\030\177\230\272\220v\253\274\024\236E\231\215\370\216Hi\031\014\016%\305Wn]N|\334\364\211\270\360\217\007@1kO\351I\365S\333\251\206\332-\036\237&\205Tp\265\330w%\361\212\007R\253\242\357k\007`l\034\327`_\353\313\371\2663M\003\376\022\236A\244\205oR\324\277\314\244\345\216w7\305\262\tW\324T\271V]\311\006\026<*=\3718""\317\273\024)\312&\316\327_\312Vk\376\342R\336mt\005";
    PyObject *data = __Pyx_DecompressString(cstring, 6900, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (6809 bytes) */
const char* const cstring = "BZh91AY&SY\213O\007\033\000\006>\177\377\357\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\300@@@@@@@@@@@@\000@\000`\036\237]\273\314\260\r\314\005\355\315p\3270\366\367{G\273\275\335\336\355\223z9\212\271\245:\351\335\026\233\2728\333\233\271\233\261ZS#C\214\322T\346\257n9\241\355\255lc\265\256h\003\234x\000\000\006\017BPE\010\323\020L\206\2323A10a\t\230\023F\246\200\322z\230\322m\003Sh\024\365\007\251\346\250=\252=G\250\363&\2112\t\"\000@B)\352\236S\324\375@\237\252y\021\352dfD\365\0324\032\0004\000\036\246\200\0004\000hh\000\002S!\010\204\251\351\3516\220\021\241\264\321\250m'\246\221\211\351\032\000\000\003@\320\000\006\200\000\000\032\000\223JDj22!M?MS\332\217SP=M\352Oj\2002\000\032\000\036\240\r\001\352\000\000\000\320\320\320\000\203LL\002`\t\2024\323\000\002`\004\320\320\304\300\000\000\000#\010\300#LL\206\000\221!\002h\320&\023L\201\240\2154\023\022e='\352\215\265M\244h\310\321\246\200\000\000b\014\200\000\r\250:\301Ta\223vI\365\367j\346\335\333N\252\314Z`\275\026\342\035\022\346\235\014\2032c\216^9n\347BQ!dMy\301\224\n\213\350\336n\016\001}\236\210\204A\241\265\377~\377S\215>\243r\t\366\203\323\014D\311/\375A\017\031\274\230M5P\3411\252X\210)\305H*:\0378\010>t\177\352CD0`\3066\032T\325\251+m\264\270\352B\377\252P\377\302^|l\213\023\262\261_\034\020P\245\002\205&mt\006f\346+\025b* ,\005X\244\212\242\213\005UDUU\025TX\021\200\204bnh\304[\213 \220oU\237*\346z\267\257\274\315\237\245\373\177go\275\344\331\260\366\004\2222\211KbG(m\r\013R\rlm\003i6$lbJ\032n\343\326\356X\20206\363]z\325\025TTQ9\212\262\320\251\r G\310\026\022\212\"\242\"\232\365\373\211\"\332\t-\000\240\221\206f\0036B]\260\315\006\225H\031\204Tj\244UQ\235\216\354V\2552\217\323\237\ry`\33346\352H\250\023\003\222\255\217&\026h\317\212\251fM\032\225\211\013B\217\300\270.\0001\214\345\346\006\241\272E\021u\316\372\350i\024E\221\232\340X\013\003e\246\031\222+\276H[jliP\363L\034n\213\025<\245\264\3654E(\270\02533\225J\327\031\200\244j\030\rL\030\016Z\031WR\253[\026;\3245\326\332\216V""\221\301\310|\206\327|o\021\243U\"\246AA\250,hb\022\223<\261\315\266\231\026\262\267%X\335\333f-UU\321\"@\034\305R\035\006\275a\037'\375`\021\324#\355\n_\344\321\346h\365\014\036\200\260\260\356\247x\322\376\312\263\244J\355l\033\240\256\307\360\263\371.\336}\023a\354\270\250Jg\230\340k\230c\343\n\263\225\227\345]\020\0318~\331\370\253k\2716\016X\252)\330\327\036\032\227\\\236'\230\200\267\026O\376\034\204\355\032i?\233W\257\356\357\213\335-#\352gT\205\006}\203b\231\251OF4\326?\311\211\266\371\302\014;zm\275\237.\260N\214\304\304\030b\001*u\374\273fRVeW\277\332R\200\202\372\303\325\347\226\321\343\000\365\232D\312/\233\321\207v\203\030gr<|\311JG<\340\305\271M\243\304jNX\244%\305\366\220\371\237\327\243t\022b.\256 \321\360\315\205h\030!?<\344\344/W\305Z\021\216\363\210@\266Rx\341\204\024{\261\010x{\033\022\t\334\211\013\230ve+\330f\314\256\032\224\267\002S\330\222zL@\355\2545\275M#\330\201\222.La\241,\274\n\276\016f\343\2165\333\330\374\177\026=\337+\267\344$L\366{k\263\346\236?gA\345\006#cG\227\303\030\306\022\271\224#\030\\\002\034@\252B\n<d\353\311\244_\345\315;\013\252ji]\023\213\352\221\250j^\315K\214\031Q\217)0%\355\222\360G\241\271\353\237\024h\273\312|4\255V\207G\241\343\366\274l\372X\027L9\224\003\321\3175\236~\t\321='\350\257\033\314D\014\034\201\325\273f\276[\214f<g\237\353\246\313\310\370\315^\211\357)\361y\244O\254\350\374\354\321\267Fyt\306\304\036\343\236\344Y[\331\214<\264\357\247v.W\325\352\325\t\232\331\314lEWj9\033\334\351D\2109\247\177&2\362Q\023l\3743\3127\235\036\216Q\331M\237\177@\261\315\346\3151\372\270d\3717\353\346\335\355\332r\371\217\326\303\307\206{\232\323|%&\331\356j\033\371\260\213gT\324\372q\312\371\233[(\302\363\221\027\263\036\007\n\364\324\205\316\323\027{]\031{Hal\240\275\231\211N\025\275Ja\313\374w.9+\201%-\031\030\311j\037\004o\312\356\320a!$\247\030z\"\023\204U\211\010wu-\320\225$\342\210r\233}4\345cS\215(w\205\302Ru\274\301h]\216\261\330\357\250\337\337\336C\300P\\F\255=\221\n2\250M'\260\205Z\352\355\322\314\220\t|\021B\210""\227w\331\347\213\243`\334[\023\245;N\353\016\345\230\276\017\212\3063\222\263\246\331\254_,\023\343\247i\2644\264*z'~\237O\351\033\375\237&\274\222\334\335\031\210\317\243`\277#\322\267*\327n\373\330\3604\322\204\251\226T\247#\"\311\031_\316\310\327\005\372\017\215c\205\302\373m\227\320\314\246\314E\313\316\306Vkgt\233-\216\226I\332E\002@\233b\023U\003\004\277\273\235w\"\020\323\237 \275D0L\022\360L\254\256M\224)\251\rB\360\233\206t/\271\2753\226\264\314'~\200\332R\010\307\005\257\236J\3140f\342\371\247cs\355\244\273\245\234\323#\313Y\275\375\2558^r\365\204s\255\231\207@\\r\3759\354`\030q3\316\r\336\037\203\026\311\362\245\013B\340\301\311\203<.\236\272/F\024dB\031.q\256\3151!\220\252\242\242\252\252\252\252\252\252\363u\367\372\374l\257\221\344\236L3\010)*#\275\323PV\357\326u\257R\tK\016\022PwdV\002f\203P\303*X\352p\3057S\025\256\030\t\260W\244\216_\034\347'\277P%\277\332^K*\334\271xb\007\307w\2353\276dN\013\324\017-\357=\014YS\252\3002 \222%u\202(\tsLW.[:\3232w\230\353I=\275y\2244c\020\032\365\235\344z\363\363o\372}\237\345\352\274@\210\273&K\3577\234\353\260>?\352\376\337\353\365\361\327\327\354\255I\345\316\226^R9wD\211\270\233d\323\232\227%!\3259*=N\016\347g\242\010\364\270\307}\240\203>/\020~\217q\304u\275^\332\313\213\351?\025$u\374\254\365\345\342[\302^\333q\351lx\323\231|a\234d\256\213\362)\360e\231\314\312\222\366\222\225\246\232\204\215O,\303\240\345S\267\005\266x\236#Mo\016\315\234\014<>\013\257:v\332\226\337\234\326,X\274\3070OPt\375\270XRN\034\355\004\277Ndi:\023\001&\004\3039\004\316\234j\232\273\324\263&o\231\211\014\200\017s0X\013\004`\276\264\276\020\305\252\342F\216\224\034\010\200\357\363\331\362R#&\267~\0336\366\026D\311\314\353\035cj\376\265\355\272\360\345\307\202\354\361;]v\256\307\330\364\372\335'0X\016\241\214uw\272\\\365C\301j\252\212\250\242\254\212Ax\367\367\316\337\234w\274N\362\374R\242B1\274\273\235sr\230\337\327\023\016\340\255\211\216\212\026Q'\350\314\351\n\303\"\206N\035\247\271\r\276\365\310\361\024\2275a\366\n\301\023\255\013""\345\344~\036m\223\224`\014G\244(*\204b#\n\274\374\226\360M\026d!\216r\n[\250\2232\3616\030\234\344\310\306f|\033\366\007&\320W\242\373I\253\257\330z\220\351\264-\261kP\266\313T\334\3209\322<\223A\337\315\004:6\371\234=\276;4\377\177\337`\275v\035=^\276&\257$\352\035\337O\247\271\323\351\256\202\n1\335\341\212\304\345\236\266fI\260!\222]7@y\275\234\030\226\222IAi\370\211\304]E\361\353\360\337\210\204\233o\200I)I\r\204\245\317\3265\317\347\351~\203\324h\367\353\366\225\311\271\231o\253^q\371\252\214\332\216B\002q(\331\022v\276*\037\025\305j\360\354<\207\237?&l2u\371\2714\002\307\217\215[\352FTj\206\375\347\221\373:<Y\244\344\346\344X\212\365\034\207OWv\333\033A\267\336\363\204\345\337d\216\331\3213\304=\257?Z\276\002\217.\2062\217\304\36544?\20522O\247\362}4\365z\221\356\017\354tx\371\035\306)\346\tP\023\321g\231\317\234\315\"\221AH=\352B\242\212.l\317\320)\232\035~g\233\203\307\323\030\331\366\350p\210ld8\036\037Mr\305:\363\271 \244\357\233X\006\253d\013l\304I+\n\244{\025\020\016\320\230T\300\300\355\320\325x\322\347\235bo\264x\333\263W\266gW\035Low\224#L\352\341\364vMU\tc\272T\242%H\215p\210\210+\233\017X\244\221\016\344\345,\335\203f{\3048\251\223\301\264\n\026h4\240G\211T8\314\306v\031T\275\312\005\312\335\300\005g\241\234`A\0316q\235\244\022\017\225\024U\205\210\321\246\213\271\n\213\211\256\253\272\244\357\244&6;l\rdh\325\332Z\263B\301{>y\232\316\027)\r)Q\2678\265\224\330\231|b\3152B\320!\001\t\262\205\333\201$\002\340c\030\213l\326\031]\245!\004$\226\272O\\{\374\355\243d\214\360M\302-\n\334\344\323\346\246\211\210\016\203\031*N\342\207\241\224\3132\257\367\267\347\353\277o\r\204$\006hM\220\021\342\3446\014\004\300i\016\350V\263\202z\320\341\232\0318\234\254\377\233,H\340\251~\372t\013\036k\201\341y\340\206\346\317\245\372X\021\220\220co\346\373H@\270#\204)\377b\274\221)\365{N\236t\246R\013\264\242A\367\372\002\360\320\"\215!\241\313P6\203SI\302\006\352\327\021\254v+\204\005\242\312<JYmX\212\235\022\270\350a\324M\r\230\247R@\311\330&\220P=\013 \250\335L\013""\351\313j\3449\022\020\332\202\341B\2338\210!\0250\200)\200W=\374\255\344\317\177\374C\02231s\253q!\225\335\264|7g.\310\204\275\3511\030\244^\025\0025\341\336\200\304@'\037o\000ort\273\244q\243s\243b\032\210\024 \203#[\326_\213\016}(2[\274\025h\264\275c\371>\223>N\327\346ylj*`\362\343\331\021\210\2174(sA\017\365\313\267n\341\022\322\231\3048\2211\304\246;%\275s\3474f\027y\347\345HS\331g\354u\037\nLH\356\001N\263\226V\366^\024ELQ\313\317l\215~\217\306\277\323\301b\024\241\016\316\231\312\354:zV\263\235\251^|\023\253\224be<\270\014\336\360\266|\270\253.\267Ts\224\347\210\022H7\256a3\2115\202\250\n\031\022\274\373\206\001\023\223|\313X\300\244\310\276\024T\000\007\210?r\032\240\330a\200`\216\261\243\025\356\271)\344\224\3016\033D\002wbo\217\030\306$^\006#V\263\337\r\032\301\277/\027\016\233\252\321\003\307\r\001\004D\223\306'3XH\214\200\342\231$d3\014\266m\346\343\032\212\n\2102\031,\314\244\205\034\370n\035`\002\352\3533\316\352\200\261\353R\204\330\2056DF1=|\"\271\002T\222J\250\326\314A\315\243\026\035\202\306\312F\224\314\304\345d\003\227,\261\rD$\306b\032\316\033\307\330\317P\315z1UAE\005\200\212\302fX\030\025v\222\215g\020,\376\013F\214\341B\035\253\305$h\000\261\312x\033\r\217\203\204\215\244\334\227U\034p\021\256;\0255\212\251\230\200\211\010\316\263\213\243\335\343\303\235k\316\365A\312\022\202\006\332\204f)\002\006U,\221*\257\323:^\303\307\317\177<I\340\236\373\305\031r\225;\300\221+U\010HJ\020D\266\205\036\034\354cym#;\301\245v\026PA\253Z\273\"\252\267\251\276\236\n\204\262\322*R\237\005\021\265\004\033\343\002\337\027\301:\313(\257\010\260\322*\252\252\252\212\210\212\210\210\252\304TUEUTEUUQTDTWe\272k\337\267-\2113\340\323\004\314\331M\017f\013JB\204\210\356Z0\035\314\370\032@Z:\257/\276t\355\204ZZct\304\tQ}\024\013#m\234\301tTu\370\234\320eZ\335\233\311\001\324\333*B\333\266\351\266\333\231\230p\007\203\034\207\230\231\241\275\354\255\2367\256Y:@\253e\2135\221\312\233H-j1\314Z\354A\214\204\212:Z\034\020*\253@\2070m]\233f\366\002(\341\321WL\346}\204\254-""\321\32641\tf\210\250\203\255dIg+\225N\205\366F\251NR<yv\314\317G\270^\316\tl\262\252\332v^\311\2132U\264\232nH\247,\252$\213\264\231i\006\n\210\010\272\030\n\222I8\"\033\225\013\202\314\344\270\241\226b\353=\0303\320\005\361\310\350\347\210\nZn\230L\321}\223uj3\311)2\357\204\321\221\320@\325\036$l\020\220\302\227j\352&J\246\235 \327\2324\335\354lc@\330\326\221\240\325\222\313\245CO\022,C\237\010F\nzLo\234\346\373%\033`#&\271<\321\t\203H\307\230\";\004\231\017\026d\002\233\330O\301\254^\234.\200Sz\256\331\2619\n\032\356\202*\255\201\365\032\252Z\245y\365\306{;i\270\014\214\372\260\010\272Xd$\263\036]\350p\216`\313\327\352\256\004\264\244M \264H\202Sy\036\267{\355uYa\327\226r\031u\376\036\007\264\324j=\213\333\215\010\313v\375S\033\033!\323\246\254p\016\303\263\363M\323\265ev)\300BH\241rp\264\221\031\200\300\213\233E>\202\321\240\320\215\013@h>.\354\202cc\033C`\2064\252\2521U \2220^#\260\3409I\224\257\261\020c33\026WD\2051\007\275\257\\\240@\007\234\245\274\2615\334!$U\347\006\005I\350Z\026\215\007\323\301 \2713^4E\3116u\321$\311\217\317--\202/j\020\036\256\354\340\306\223\253\251\222E\001Fpl\006:\273F\250\222PV\231\002\022G\243\036\236\204\2730\200\357\264\314\r1\226\255\341OLOw}0\306~ Ru[G\007uh\251\231\347\234\313\226\tfKPv\313S\360\253\030\202X\0068$\354vX'\346\262F\001Y!#\341*\033\340H\342j\265\037c$\247\275_J\030\331\006\367\337\230a\335\341\000\320H\235\035 \311\203\305\002\265\005u\326Hw\0249\262\027\206\341\241CcU\203!\241\3718\361\343\247x\222\275\371q\355hm\3459D\340\0234\230\366M\010*(\321\007\215\201\220\360<R3\207kH\2640\200!\2460c\220\243\213.\033D\312o5'C\026E\357\310\016\230\261r\324\214\224\337\2779\334\200jb\310\n@\002v\211\030\276\311\321+k(\030\374\033@\223;@\355\004\332`$\014F\274\227\323\036a\0051\235\rc/BKn\tB\331\333\366\253\367[q\315fR\374\001\351\327B\305HQ-\210F\306\023V\231j\346\350\350\2504\264%e}1)\314\005\206w\305\022\2579\216\"\2356f\313\211\264\301\273\321\253\022\2219\333;h\234\244\242,\324\304\243Ws]\352\214\\(\031c\223\264\302um5""\230\"\214\034V&a2G\036\" \232a\003\205\224Z;\234o.\210\014\010r\360(\200\"\222n\001(b\310r\242\036\375\010\350\237\202\021~\001\303\202\355%a2\300M\2272\345\005d3j\014\220\247\303\302EC\030\315;!M\356p\035\270s\307 \214\021Q\213\010k8\022\022D\335\227\320\222L\002`:\000\254\005R@\301\242\316\024H5\0320\205a\310\233\2318I\031\265)E\202\221E\221`) \244\225%f\320\304%\222a\004x\234\214\210\032hv\235\313\267\331\211 \342\330zb\0368\033M&\306\215\242\271\245\r\0235\3239\244\021\324\351UG\326lCF\360\3360\341\332\252,\021\177\016 \261\n\335\325\342\304\206\343F)\264`\251\001\n0%\222H\"&\246\004\232\370\257*\302t\034\201\240X\206\210\001\214\362 hE\325M\206\331\246\311\301\313\335I\2337\3520\326RR\005R\227]\021@Y\030*\240 0(d\201\205\356l\t5l\313,\216\306\016@\241\023\004P\210\231\203\007\016\224\014\231w\206HN\347-\312\004\210r\257\207\303n~\0351N\017\234\022\021K\331C\253\247N\034\213\370\212,rL\016\371\221eo\301\006\305|n]H\252\030\231\217J\027\244\0371NYc\005\223\345\262S3\320\236\224\2031\007\031\344\244\021\212U)\250.\202\261\337\222\344\311*y\220Qa\256\016\215\016\231F461\261_4\"\241C\014x\270e\267A\342/\026,|9<}\303LI\270* \230\217tP2\226\232\212\240\213=\221\2313A\n(\031\310T$\224\324\222&\202s\351\355\367\320\240Q\213\025\001\255\030*\263B/\013\334\024v\035\035,\013\004AT\020\202\311mQ\210\"\210!\030\254A\221B(\304\202\220{Dl!<UHPE\030 A\221\312\331\025\001\214\2021r\207\306\224\274dP\333\301\005>\212D@Z\230\213zZ@V$\207\265\035\257\303v/\\M\311\367\273\274\270$\007M\373\325\274l0\312:\213\230\276h\240\002\3501a]z\337'!X\014d\325`\352\2326\343^\342f\320H\2536\032P\035\033\211\034\313P\330\322M\000\340a\206\025\205l\222 WC\362l0\313\215\010=\026Z\\\023I\006\275u%P^\317j\001\264\r\201\214\022\316\230\022I\260\361f)\004\020\322\010h\320\216m~\347\227]@\201X\204t\243\260G>\030\271+fr)\"\237R\210\234\312\244TK\010\236\207|\251!\2206\241\302GQ=:^\025\214\224\244\325\031\312m]A\261\205\206\303Z\250\320\326\246\335\201:1{\322\202F\2107$\244\300\206wiE\307\322\354/~\301""\271\220\302\2741\324\030n\315\221M\2661\2661\266f\310\244\253\315K%P\363P\253\000/\005\270U\266\337\316\025w\316\273\240\300G\\xJl_\021\234(\323m\035\332\307O`Q\301\233\242\340`\025\316\002\211 \343\032\320\220\004s+\201\277+\357\341\214\305\3028j\265\237.:C\032\231\260\257\220\303\222\0228A\367\245\211\317\004s r\357\354\354\311<\326\241\240\216)E\214:\211(Y\351Q&\206@.\207\312\273J\274\027\215\236\321\001\260-\263\266\370\2435+;\355\021\254Z\026\022\310l\322\256\252\"\034\0305\231\211&Q0R\212)\221I!\024\350\247\230{)\010,\000%$\222z\251\226\365\214\004q\024\006\002-b\010\023\262\021V\020Z\250f\263\025\245Z\350\214B\343b\342\220H\272 \212Y\305f(!\034\344h\376\346\360\2014\0016f\ns\344\031 <\346\022\024`\360fi\231\017}Y\342\220\024\327\004\344,F\254\372*\341\342j\025\030\261\202$\010\204\326\027T\341+\260\201\214\016\214)\303\307z\270[\263\014\200\230P\201o\344\304k\222\034\"\256\010\317,\320\261\314AT\220*&\351qId\234x\325\220\201\241!\024\2026(\254\222z.\314\264\010\250\333C-pC\004;7Z\262fd\303&\021U\006\242\225\n%\212%h\224\215\240,\201\266\342\003\035\254\235Ub\252\"q\226\361#\204\262T\2103\262\273\023\275\300\224$\301\300\221f'M5\013\025\263y\031q!\215\202\\3Rw1\027\335,\261\027\234\216O>\001\027\340\220-\253(\032\365\257\272\353\314\230\250\271d\323\027\020m\361.as#\217\201\331\316\274\306\255\277\201r\232\004\013X\266/H|\3036R\244\226\246\230\303S\342\210\265w\256\355\246\303\202P\305I$\r\233\213s\347\tDbrb\310\313Pr\273i\023\304\203\351&\025\333\230\031\364\003\244'\202\2453\364\002C\022!,\347\016\007\003\232\241k5\255\007'#lhI\022\327|\252\0202\002\177\000+\313\313\371\371\321\220\261\000cb\354\301\355\201\304\320\013\247\ry\254\334\224f$\020NT~Q\220\371+\270.{\034\261\325t\247\016\247Jr2\375+N\235!\240\227\301\344\330\361\273\323@\241z\2066\004\306\020\232\021m\2737\0230\353\006\007P\376\250\0239\244#v\336xBU\316\254\273\022[m^\2466\323\002\230\304^~\033\020^\000+\310b\026\305\237?y\310\201\023\236\335\322=\247RDx\030\350\230\215\311>\237c\372\267\325""\361;\337A\331\373\221\036\202\014\336\257\265\235dk\352j6T\215i\306V\313\0232\246q\253\013\026k9\265\2149\227\237ir\212\306q\024\262(\177`\201q\341\376\340\037\200H\242\375\370\024\010\371\363\332\204\373\304\250\300\360\322C\354*\215Ei\362\3560\225AwO:\303\325L\023\257\300z\0019\337\2020=_\352\371!\022\212\371\351\377$0Y\211\357\276\247\361\351\t\343\004\315\020\200\274G3k\336\273\237\342\345V9\014\275\226Qn.?M\277\221\322\025\206\372\273)_\350n\252\010.v{\247D}\367U\353\033\313\364\360\224\2771\344\002\271\351\313\371\372\265\033\202\000\216\351\327_5\023\300\013\032\276s\222\222!M\255\232j\315\246\010\310\335\337\357\373\340\251\366\324XrCV\240;/\321\231F\377a\364\257V\250W<6.d\310\37100\254I.:\274u\377Z\352%\247\256\td\371)hV\224}R6\336\305\230\332`du\330\030F\343O\223\017\374z\212\335I\002\006\262\242\014\250\235\225\267o\364\352\214\233>7\211\t[\377\010\033\017\327\357\234]h\250\250\210\252\220\357\366}\234\016/i\275n\345\267\207\\m\2301\360\264q\033\n5\266\031\206wt\315\267,\367Z\264D\202\226\240\356\311o\223b\305dZ\274L\372\373\026\340\355\013Dn$I\202 \352k\031\311\\?\233\007\346\266mZ\367T\263\360\004\344J\306\277\231\366#\021\365\340\327\004J\351\240\n\272\2255\370o\236\036=\202\324\250p\312\325Y\265Q\252o\277\225\331!]\205\341\227\304\273\275\325R\302\275\233O\345Y?\217\202g\3725\206\362<amS\306\256\315P5\245\255\223\272\245\257\335\004CY\342Y\341\262\266\004\315G\025+F\255d\371\"\265f\177\312_S\323^2\264\323,\253^\250\251Z\327\344W\375\213\371!\247cs\210\250\025\334GT\204+_Yy5~\365\005\255^\270\243\214\275\326U\213\242\036\217UR\305\214\312\304Z\302\213\336$#\2620\261T\351\365\354\n0*Ydo\307\374\374\353\255e]Z\254\347rv\247\237\035\235\252(h\350\352\261Qq\274\325M\367X0V\225\"P\324\350\255F\236\272c6\370\261]\274\006I\013\245@\247\333ll\0054\241\000|L\360\242\324\024>-K\267\026\243@\300\357:\224i(n\355w\251\2554\275={\232\024)\014\315\307\004\366\351m\"\032&\215\215!}f\320\260O\013\321\303\324\244\356j\0358\305Z\016\245\225T\030\220v4`-\023L\331h,U;""\005\017G\027\211\351\215\244A\225\034\375R\222\252\212\024B\362\202\347\023\224\335\320;y\276m\001\3623s\014\327U:\206]5\352 f\033\325a\230D\367{p\0217\0275C,\313\312\300\311\246\2107F\311\373u\366\306\360odc\243b\357Wl3\333=\211\346\257\277\r\272\003\340\340\027^{\365\201\234]/5/g\265\344V\021\366z\275\241\300\250\010\246\274\234\244C\034%\342\177N\256\037~\360Z\364k\256\251\356\345\"\037\207sR@\276\223\326\272\006\026\357\213\321\312\362?:G+\231{\211\205\031\356\36475\333r\222!s\301wLf\243\333\223SC\323\212\333\032\024\327\357O\265/\357\271\366\361\036\023\271\363\307\317\014eLlF0\234\021\261]\261q\244\306C\274\t\323\343\273\344\223\342\376X<\023& NLdBj \334+\007\271VF~\352\274\353\264s\3230`v\266\304\316:T\251\262JM\376|\342q8y\2023((\"\326\036\234\210#\0058\202\177\352\014\353\303\315NK\206]\346cc\026\261B\315]\305\273\306?$N\226\370{\036\335\t@\226wpJ\036\261\235nm\266V.\360U\3165\276\253\317\275\275Cq\033i=\205\245\277\220\345\233\363f\225\277\266\267\235e\362\335\342\202\246\354\235V\007\3043x\nZ\2102\344I\345)\216x\315\2403\311\367<~\317?\245\325\353\375\\\\\023\0326\232\276\355\254\346\265T\220\374\251\304\254\213,,\342\253Vt0\206$G\244\2400\2424\272\024l\264\242\327\332R\212\327\377\027rE8P\220\213O\007\033";
    PyObject *data = __Pyx_DecompressString(cstring, 6809, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (7015 bytes) */
const char* const cstring = "x\332\255;\313_\023Y\326\360\373hE\005%\212\240\335>\n\265\005\024\323\203\357Fa&\002\"\255\242<\024\247{\246\253\213J%\251!\251\n\365\000\322\323\337|.YfY\313,\263\3142\313,Y\3262K\376\004\377\2049\347\336[\357\252@\343\327\2776T\235s\3569\347\236{^\367\346f\212\313pkoV9Q\322\0149'\213\202!q\202\222\3456\245\n\227S5\316\324%NV\270\227E9_0\322\031\316\250\224%N\315q\202h\310\252\302\031\005\301\340d\235\223v%\3214\204\215\" \025N`\364\234.i\333\262(\301\270\035M\006\316jY\322\0042P\332\025%)+e\201\203\304\211EYR\214{\242\252\344\344\274\251\001\264(\227d\020G\205\224L\335\3406$\216\275\312\212n\010\212(Mp\272\241\311J~\202\003=\r\263\\\2242Z\336,\001'N(\227\371\222d\010Y\301\020\334\341\002\243G\362\215\212!\351\023\234\242\032\334\250;J\332-\313T=\336\220K\222o\340\032\274\202\320RyU\024\212\202\026\036XTE2L\247C`\036\206\000F{\303\300\256\306\272\243\262\236\250\203!\213\233\222\021\020M\000\341I\207\031\314\n\nX\276X\341\312\232\272-g%nM\023D\240[\205\025\220\264\267r6[\224v\004Mz\t\013\247j\025\240\025%w\214&\031\246\006vv,&\024U\320\021\271\010\334\212$\252Z\366\205`\210\2054\014\030%\323\003\035L\321\360\343V\rM\022J\\NSK\324G\200\026\025C\377\231%\313\2331\215\302\212$d%\215SM\203p\367\020\257\300\347\212\222\226\026\340\031@\304\017c9\254J\312\2618P;\304\350\340!\216\314!\244Cg\016s*Y \360\233\"7\257d\313\252\014\253|z~\267,\211\206\224\235\342\234'\2771\035\0255n\rCj\202\3330\r.\257\032>j'\304f\201\357\2732u>u\343_\200d\016\301\320\304>\001\2058C\330\224t`\020\261]`$\235\325\013A\227\322Y\225\317;>\311\\\305\021?\007\356B\227>2\n\206\3609\002\344e%\247\306\016_D\204\347\332l\232\\,/],H%!\216\327*\301\254H\272Y4\216\302\255(\353\216jz\200U\214R\272\307\3479cD\246;[0\225MnG6\n\034\206\314\224\223\361V\336\317r9A.\302\022\021\344\373\212Q`\351\216\254\022w#\201\020\022\214.\344\245)n,}g<\315\315A,\312\305\251\310x\212g<$MS\265)nAR0\255\252\032\013B'y\310\212l\310BQ\376\335\221\001\361\016Y\230\220b\016\017/\341\204\343n>W$\3115\022\347\216\203\022\207c)h\001""\376E\335\202\333)\250\020<t\361\270\254\n\236\207\304%\344Er\177V\022!\243\202\206\214\004\3642\nPQB\223J#\377)&\304\247\317\3773\177\\{\255D\263\266\260\001\021\016\322\312\002\224F\321\004.t\321\300 \314\376%7\255\246\027\225m\260t\026\304\351\242&\227\321\302\230\006G\274\314KJ\252H\363\t,\316[\\$'Y\323\312\306\342/\200q-\352\362\215\247rj\r\303.\251\030\350X\234g\251\003\301\214\263RQ\336\3009K\220\362\261\212@\"\321\220H\341\336\317\277\277\367\360\351CR\3715\211,*\247\233\033`9]\007\213\202\3156L\271h@M\303I\351in1\307UT\223S$\254\340*\230H\017\014\300l\003\305\337 +0J\346\314\352j\245\014Ei\224\313\312\032\010\221\267%\034\375R(BT\276s{\003\370_,\302\252\242.\350g4\262\211\032$ti\357\241\207\372\2025\322\231\260N`\325\300L\207K\005\263\023\364\212\"\222\2653u,\235\344]V\323k\250\\ OBiS@\257Q,\205\0055K\255V\006U\201[v\202\224\001?\275W\nU\222\255\313\025\001\"r'Ms\213\303\215\313\231\212\327\271\300\214|riVJk\246r\270LF\213=\225\344\022{\034\345\022\314\033{\010\260\033\305\352\276\316\r)\300\221\005\300\300\242\213\230\275tH\014Ai\304`\270d\244[\343i?\347\360\022\310\002\374%=\371h\202\003I\220H\211n\036\323\222\260\313\373\030S\315Ns\360\037\nw\033\307\210C\247O\023\242\214\001.\t\271V\322\311\353=\367?\212\376\260\364z\351\335\372\022y&\344\n\007\242\024uG\t\307\034\343\367>\263\366\312\243v;R\232\2254\234\263N\215\265Q!An\024\330\300\331\267sG\036\247`\253Y\224i\354\335\313J9Y\001\214\250\226J\020J\214\337z\001\262<\007%\314@\347S\244]\210[\241RT\005X]\r[0\3102h\030\303\220Jeps\210\010,\267\272\212\226\307!\000\000\221Yn\314'\213\264\326`tw\325Y[\215\025a\374\306\350\351\231\231\361\231\364_\205l\226W0\025\370\033\342i\354\006\370\002\255\371\276N3\322\307\320\\\"p\243\3676\300\2216\324lez\2146\235\3433>\243Oge\035=ER\210\277H\254\311\321\247%\247YY,\213X1X\2372A\252i\270\333\236\316\213\\\201\204\273>\215^\211\242\235\"\354\025+\247\203\222u*-\373\233\323{\377\306\tN\017\035n\370'hN\300\010\025\242M\271\327\275O\003\005\310\227\262\323$\241\355\300\333""\364\030\274\n8\211\361\031\026\335?\260\326!]\256\354>\017E<\333\241\240\027N\207q\320z\310\"Z\027\303FS h\"$\321\226\016-\003\376\221@\351\305\020\361\337\303\251\304R\366p\"\026i3\361\204n\017Kw*\t\354H\017E+n\204\302]\2010\202up\324\321\302\310@\223\3078G\210\330f\211\251v\232\324\017^\245\266\234\206$;6\216\305\305T\374\235Q\270=\034\325\003i\235V\252b\205f\342\337\0161^\0322(\377o\\\214\t\226\004\376\367\267H\376\207\024^\314\245\331\016\332\353\010@*\250`\320\212*8\235\037\355\261Hf.\303\264\212\270{\304\341\033\350N<\206\362\261Y\210\216i&\350\253\251i\020><Mu\024\306\232\246\343K`\373\331c3 m\366\261G\263*}\334\341\260\217\307l}\334\361\276\272t\\\026N2=6\003\262]:\356`'3\036\227\201\003\227\025\262\377\335\020\304M'\265\207\332o\"\216y\343\261\325\245\335\342W\014'\271\345\270\303uz*p\374\341\244\236\037w8\355\330\276\326\202\204\313\361\224(\230F\026\232\261\243dX\340e\010E\236t\022\323\354E#[:}z\014\334\001\032wM\310c)\037w\366\306\264s\231\342Ns\201\211N\323\202\353m\000x\357\321{J\227\204M\211\355\032(4\315\203\300\254)J\274Hf\304\363.\034v-:n\036\302\030\010fI\2433b\020\357\035+\302,\366\022E\350H\310\333\274\263_'ols\230\241\373\016\254\357\276G\220\211\306\002A>\230\240\363\302\216 \223\016\334\017\337\201\231\230e\006\361oEb@1\223\214%\212\3168\206,t\232\34363\356CT\232\037\025\221\341!}\206\365\200.\010\232q\2348\366\023\274\367\000.\371Z\252\274\027d\315\377\030>\317\212\036\016Ft\214#\211\350z\310!c\004\213\2662\324MI\t\037|\206\337;\351\343RtP\207\321`\336\013\237\220\206\337;\211r):\210b4$\372(\324;\331\010\277\2633\346\004p\222&q\204\t\nEI\201J3x,2a\212\303\305\035EN\032Y\363\320\322\301>\002\262a\004\r\351K\222\267\245,\317\2660\021\002\254\016\220&\035\374\334\273\265\314\2337s\357\370\314\354\332\342\273%x\230\3774\373*\263\2640\017\217\013\363k\360\371\376\303\232\327Wb\032\233W\314\022\377\362\315\342\302\2535~u~\345\343\374\n?\277\262\362n\205_\231_\230\377D\016Q\"\033\210\010 j\2168\222\210=\034\"\226\343\346q\233\031\007Kf\037\242J""\222@\354\026JP\270\335\326\202\024\010\335\305\244\3319\341\035\226\351\202\207\344\220s1\363%\236\234'\"x\332\214\223\230\017\236'\3411V\334\tS\000\226UYq\nC\245]\021\266\351y)\014\207\004\023\006\225M\243S\276\216\340hc\037\000\373\317\326\242\010v^\036@`\205\342q\307#l\013r\021kU\374\267\002\336{\322\022\005(\022\226\311\213\206\310\256+\211\253\237\342P\256\376J\024\273\257c;\272X\034n\371\"\210\020;g\353\034|KR\336\207OP\335\245\210(\356b\302p/n;\206\353!Q\272\350z\024>%1a\270\016<\242\212\023h\004f\340yI\321\247|\000\224,?H\224\240\310[\326\\\322b\032\007K\022\020\241:\222\004R\256\203\210u\322v\307\301\016\023\355R\035\"\232\321\221\362\355b\nj6\334\232G\276+\013e\337 \306\227\201\003\210X\225\003\024\t\352\006\277t\364'\305 &\230\030#_U\306\201\335\004\231\374\025e\207\257\035\343\277C\014$\313\204/\030#H\315\214N\211l\376\242P\266\247\212 0\357\372\201\276\310\360\001:/DbT\004\250^\312\n\211D-\036\032\025\221HwD9\351\034{\212|\331\032\001$\316/@\222\344i\276\3571\243\220\316\254\017\213\367\000\225H:\237\030\0049\233\204\256\313\217\362'\002?\244\263>\207%\201\000UVU$\036\363\000t\243\024\215\227[\262\357L\177q\010\200\222\204\207\211\022\244\177P\374\255\222\277u\214\303$\tK\240\355(S\325\360\370!\"\320\007\356,-H\230,\312i~\202\222\002\320\016\202\302t\tr\310\362\255\202B\363\354\346\224OZ<\316=X\200\375\204\263oX\\z\371\016_Wg_\315\277\315\204\016\341\302_\211Gt\216\022D\224\205=\314\334\352\253\314\353\371\305\245\217\2317\213so\026W\327\330&g\225<SEV\235/\001\234\277Qa>LD\212\213\223\266L\330\367\270\257\330\211\345\2652\264\342b9\006\030Gi*\362.\357U\350\320\035\234DD\362\220\350L\376\004iG\332\210\031\376\024q\007j'\025\035FBN\343;\020\031*\257%\231\215\246\237D\304\221\254\226\234\350\222\2117\244\274\254$\243\311\016-\031MO\033\235\363\307\303\3506\020r\030\0219\323;\214\010\217=]\261K\220\262\227Tc\321\373\202\037\277\333\346\371\367\225]\3707'\213\006\277$\355\032+R\216\307\205x\017{\024A\177+\357\312J\314\305\235\020 j\3678\222\210\275\351\367p""\3643\216\005\203'\214\363\367\375\014\342\276\323\357\371\374\337\366\371\237\243\262B\330\210\304\000\336'7\000\367\240\341\357\300\243\227\373\242\032\304\220D\325\350xI0\212\225u\236\234\031\207\357-\206\337;\251\223\234\013\"4\030\266\341\013\216\341\367N\242\222\217\020#4\304\301)\024\017\235f\351\227l\021@\222\264 I\2028?\021\336\201(\370l\027\306\031\032\336\302\213Ab\367\357\335\360\212\342a\211D\347X+\212-Kq<\021\312\313Y\\w\243\022\276\233\233pW\227O\200\257kB\271\014\354:\243}G\243\207QF\253\321\241\003\022\354\177\204C\337d\302#\363\3540\263$\333\034}\252\035\346\230H\033<$N$\013\235\005\207\311\016\267\325Q\214\024R&\202\016+!\347a\337\265j\250e\226\201\310UPz\237\202~F\325r\341\021e\030\306\227n\031\304\367\036\270Q\237p[\275\363%\366\316\330\030}\017\243\217\316#~\204\333Y\257i\246\304\256\313|X\233\245\307\001\364\023o:J\360\010\355\251\227\200|\351\306\177!\013\275\002K6=~\366\177\365\007\317\033f.\007\344\272(\313\354\336\242s}\021\312\264j\3026N\322\261\224\370/u\371KK\32295O\245\360\264i!]\022^\274\001q\344{Y\221\035n\210\250\200\310\213\2449\221\005\221\367.5\300\263w\022\303\323o\317\t\254l\032\356kA\325\3413p5\020^\351]g\321\227^\335\273(\"9J\205OU\203\201\364\364E\244M\223\210\306\303\365\244\311\024\035<\350\344\344MW\321\372\005\254h\272\220\223h\212\006\253\032\370\023\027\374\007\232\010\262B\324qu\342yru\025b\233=@\362\207\031\227\360\025\217\272\341\023\266\315\262B5\300\213\014\244q\024\213\272\250B\376\247\347@\354|\030\325\201%f'\375\216\262\240\017,@\3164L\230\254cMS7\324\222\353\007\316?\230\202\251\211\260\217\023\262(6\013\254`O'\345\004\260h\026\272=g\t@\246\267\032\336\023q=_\350\361<\016\342\351\037vW\217\247\327\rx\370G\177\365\203\274\234\0237\367!\375\034o\200\024\365\2314\357\302pe\3130Y)\006\344\363\007z\020\307\234\001HE\374\360N\036$\005\347\344\334nq\257\014\302\203NZ_\347\324QR\314\022\335\343\001c21\374\013\235\221)\271W\342\235\203\310\320\205B0:6\034\273\260b\344t/G\302\\\226t\372Pq\016\232|'\373\376\355\243\177""\327\030\330,:\247\375\370S\027\022*<\217\027\274x\236-n\336\331$\223\007\331ul0G\350\274\021-\304\027\245\274 Vxz\355\234g\253L\020\252Z\016\266 \370\246\231\212\202i\333\301\322\000q\277q\346\221'\315a\240\261j\226YF`Y\036\243\021\\_-\001\013\242\001\313c\316]H\367W\017\376\336\206\307\027'\3278})\006\207\276)U6A\261\274^\2247\310/\266\374\247\242\376CP|\006\221\304\233P\007\347b\221{\365\022\247STw$\r\"\256\004\321\211\237\356\235\rr\231?\220BX\002\341I\350\260\310\245\367\224=k\001D\315\232E\362\027\336\230\005\340MS\321\273\320\023\340E\317\363%\023\363\027Y\3372\315\373\344\026-\317\343\035M\372\231%\027H\341Y\332\301\217]C\321\351\035\030\266\266\354\336\250\n\251\026\355\224\007g\316\253\020[\032\264z$\005\"\223rY\2205\347b)z\0206\203\201\206\260\254\2261\355\361|Y\223\312d\neM\336\306\305\004K\227w\312\025f\020x\360\346\t/t\323\r\017\364\376\216sG\221Y\337y\225\313\242\363\010\353\005\274+hQI\334\324\315\022}\243I\233>3'\302G\014;\372d*\344\276\217\024wE$D\021\271\026\021\213\177\353[\256\216h\247\027\016R\305}\271\034K\342}\277\030\213N\036\030\370\022)\226\302w\234\036\213\017\034\223\306R\304\235mv \364\035K&Q\005\316\024CD\221\275f,>qa\2226)A\252\316\255V\210\370\260\r\316!\324\001\262m\322)`\035\307\252A#X\2230@\234C.\357$\313\177;\230\206P\370\032\207\333B\362\321\r\203\003\220vy\0268,|\300\342nm\242 \235\376\276LSUh>\274\037\332\352\220\314\261E\321I\013L39^\303#e0\330\236\273\305\334}\310\222\nN\3138\364\255\274\257\034\342+\2359>1\025\240\030\323\332\342ks\371\230\226\327\371\322\t\323\254^\224\2442\200\212\252\001\246\360\266[d\004~\310\"\373u\010<\233:43e\247\005%\317\244$\351&,\016[\025\034\305cs\246\356\320\213\301X\250\331\035w\303\331\021@\301\rX\t\337]\323\351\356\031\243\241\222\352Kd\370.\024\006\256\023\006\372E\267u\303|f\226\241\323\222LM6u\3115\002^\314w.\347\223\036\203|\350\244I\252\260N\020\233\346\350\275\007z/\017\274Q\301\177x\037rG\022\300\301r;\3249Ib\366\035\022\006\317\025\003w\032\351\013iJIM\245\323\362\235\035\306\234\020""\322\274\377\276\362\216^\314\2743\306\221<?5\0059\177j\n\317x\360\007Q\372x\227\217D7\262SSz\001\177\033\307\227\r\355\2713\344\005\331p\314p\364\026<w\373H\203|\207\206\177r$=\207\373\223\203\310\346\324?\006\257H\2179\034\2113z\270C':\346IL\246v\365\014Q\223\037B\323\334\003-\001\377\204\225X\376\001\326\330\340\017_\302\353\022\304\036\205\0319#N\346\346G\217w\361\350{$XH1\327\273\034n\004N\367\225!\030\256_\020D\263R\020F\274\260\213\264\016<\215|\027o*q\314\031\224\361\"\317\2402\357\317\277\0364\020\014\237\273\333=\223\215T\343v\263\333\356\271o\337\177\331\022\276\\\352\352\237i\256\2672\255\345\203\3363{\017\367~\267RV\272\336\335\356;_\035\267&\333\003o\3663\373k\366\362\212\275\262\332\356=\267\267]]\261\207\357\326\247\233gZ\223\355\376\263\355\276\353\326V{`\260\272`=\264\264\332\325\272P\337n,\267\177x\320\230ldP\334\375\306H\343q3e\343C{\370\322\227[]\247\316\355\t\210y\330\3104>6'\355\236\361z\352\313@\327\251\301\352\303\252i\315\002\227T\273\367T\273\257\037\331f\252k\326\325\232\320\2760\330\036\270\340#\030\274d\235\260\004\020=x\361`\360\"\240\277\234\350J\235?\030\000Aw\352#\355\221G\215e\200\364\217\324N\327\307@\203\311v\3374\235$\362\345Fk[\365\356\003\246}\255\247\266P\177X\327\032\327\2320\223\241j\261v\017\347\320\020\032\333M\260\311\271\275-\273\007\331}\333\325?V\333B#=\257\352\326H\273\357\212\365\2626R\003\326\027\252\223(\354bu\036l\367\275Ehf\254\341\032\030\361\232%\034\370\254\364\312zam\326S\365\357\211\204ls\004\r\001\314\033\271&\261\326c*\325\356\271e\337z\332\354\376\322\353-N\3775+W\313\264\373.V\227\333\251\253\326?\352W\300\316\251\363\355\201\233\240\002\230\343\244e\324\356\327\376AV\367L\353\361~j\177d\177\362\200\220\367\rT\317\241\374+\326O5\241Vit7\276kf\332\243\177a\0170\347\274\265\014\212\342DP\013\220\334\034jn}\316\330=\337\302D{\3512\014\203\241^\330\267\001\t~`\237\273\201sG\352\347\315L\363ck\362s\346\313\331\256S\247\333}#\265Tm\274>Y\317\264c\014\334:\321\022\200r\260\353\324y;u\2436V\037\251S7:_\275c-""\325G\354\273\177ku\267\006[\324\360\2373m\342\223[8\205\323\326\310\347\014\365Q\243:IGd\254\345\3002>\202)\245\300\321\234\3017j\243`\355\221v\347Q\217q\014hu\245\353T\037\320\355T\263\326Mk\265\326\355RGfr\271\211\364}G\245\267'_\264\250\200\376Q\373\366\223\306V\304\367.66\232'\232\002\030\350\033\032\210\217\252'\2529pv\2636W\377\246\376\2611\323\272\320\312\240\200\021\3272\260,\355\336\276\275\371\352w\326\034\370\371\355\006(0\\\335!\016F^\200\256=p\031|r\024C\352\314\036L\177\310\036JC\214n\021\247efBe\372o\201\234\223u\243\361\240\221o.\177&\214_V\301=\301\005\277\351\337\313\264{\372\366\026\252\223\325\227\326\004Dc\317\311\317\333{\353\340\356\2030\327^\320\251\335;\\\005\267\207\017\304m\021\007\231l\014\202c\347\233\277\354\237\334\007\\\000\322\3755\214\3577nA\230\35447\367\207\355\367\313\007AP\352k8?l\314\201\353\017\267\316\354?\201tw\020\004M~\r\347g\315\207\260\266'[\377\266W\376n\377\375\347\203\020l\365kx?j\2545S\315\321\326w\373\013\366\352\332A\020\224\371\032\316O\032Fs\262\271\320z\266\237\267?|<\010\202\204\257\341\374\264\331\003ic\275\365z\177\307\376\270~\020\004m}\r\347\211\372\034$\201a\310\201O\366G\016\202\220\257Z\302\2776\215\326dka\377\231\375\361\237\366?\177=\010\301\326!\276\007H\002\274b\275\252ej\204Q\272v\266.\264\257B\205\253\217\372\022\023T\213\000\341\331\275M\353\022\306({ Y\353f}\r\322\202p\224!\303\265\223X\321\234x\206\330}U\375\t\312\343\016\244\373\355\372:\024\332e\007\374\032\222\016\022\237\250\347\261\306\221\254\r\361Oj\323\022fc\024\324\2677m\375\017\024\377\276\357\240\252\357\326\376C\242v\271)`bb\030L\037\375\227\255\213\226X\273\200e\351\262}\371/\230s\256\330W\2364~o}\273Oh\246kg \275m\001\302O{\335\276\376\2549\331\346\350\000H\230k\265\241\232Q\177\002A\\h\n0\316\276p\207\024\006'\323\235\257\336\205\202G\022y\337\336\033\253\307z]\333\001\273\202zO\355\233\017\260\272\237#\331} \205u8U\375\246\372\263\365\007\246\365\003\250m\2425\204\305\357Bu\n\212\234L\006\016BYn\017\300\352\002\253\205\332$\350""\344H\n\260\037\254\276C$\201\333}W\255e\232\363\221\377rU8`)\222\324\275\201\275\377\000\367lm\324\036\207\251\005a\343\366\335i\314\251\001\272\372`}\305\376!\323J}&\302)\364.,\371y\373\301|+D}\327\276\367W\254\307~\330\367`\261\373\004n\367\200\321'\352\350\"\375\023\264\200\246\332}\343\330 \020{z\265\346U\375E=\007\336\360s\223L\266\177oe\257bu[)\234\367\"4\n\360\347\247*\370\304A\337\367\265\265\372p\243\247A\n\356\223\352\315*i\234\240-\303\216\3432X\264\002\356\0066}l]\2602\355\301\253\326\307\332#l\032QN\367\001T\353\223\325mb/\010\211k\200|J\032\002p\326|\365\2435i_\271W_\256+\320{\\\376\276\266\\\313\303\213\353\347\341\001\377\262\316b\377w\235\371mw\022]\221t\255!:\273\007\272\221\366%4\316y\3178\007Gh\006\207\032\244\031\0047I\321\t\303\2740\334\006\355\301\333\240Oo\252:L:\320\377\2038\372\324\\&\2101\224\032A\234\333\3737\355\\R\325\301\352:\224\352\356\266gS\024y\242\226\253g\350\214\306 \326>a\244\265{\007\252}\030\220\355\357P\277\223$\206\330\314/\321\026:\003\035){\030d\017\007`\007|\277\345 n;\017\234\3630\306\036\332wf\232\002\2749\375%\006\"\r\205\276o\261_\250\215\020\223\\\364\032?\360\341f\016z\220\2319lD\250\342\260r\007\314{\221\371P\327\251;\36680nV\366\273\367S\355`\347k_\303\216s\250a6\027[$\037\215'\323ZJ=SG\3779\335u\366:m|\277\205T]lL\200m\234\256\367\"f\366\223X\220\332\203\230b\357\342~\002j\3102\311\327\330\207btB\017}\335\312\203\233ADC3\204=y\241V MP\357w\220\312.r\260\262\227\300\333O@\013\261\205]\230ch\377\310\300\240)\322g\217b\223\014\3764\324\332r\363\007\375\223\206\250l_\201\rN{\342\236/c`j\035\330\373\003\323\347PU\205,\016\355\332\037\265\347\330\215aB\352\003\377!R\317\236\013\372\342\245\346\371\346\343V\2525\322\232\014\314\354D\204\362*i!\273i\277\253C\035cm\236\323\256g\334\315Hj\254\336S_h<l\350\315\t\322\222\337p\230\271\253\365\0038\335\211\206\324\374\261\225\t\251\305\362\010c\207\301nX\367\255\0175\342\346\230\212\237Z\3238\027\264\207Y\235\255\262x\035\200\335\34324\313\340^de\001\260S\025`\354\323\332L#E""in\201=va\031\272\217\222,P\030$0\314[\2571\337\020\257\371\025\334a\010\247\373\304WC\250\3511\331\rZ\237j\037\352\267\352Rc\222J\344\254\337\353\227hq\306\0029\0074\327j[\355a\3600\260*\311.$\223\\\265\257\246\35544\362\230J\334]Yx\007<\004C\007\321Us\365\237pWG\2039e\247\320a\235)\301\306q\254\316\232\201\356/\257\272\273\276\351\203M\345\226\325Wc[\256s\003tN;\270\nd\343\2647\002\373\334\203\024X\300\356\201\217\366\025\210%L\3707k\023\365\002:n\314\016\227\304\324%\260\017\323n\213\024>k\033\274\367*\206rk\271\225\333g\246\331\302\255\334\351\275\273U\340\017q\t\301\016Y\304\17720\005K'\303v\204lAq\016\320\210\264\373\261\206\366\342\316\007a\367q\347\223\252~\313\220\364\004\301\202U\272MVM\006%#\366\272\014v \366\222\331\246\033\332\256S\230\320\006\210\317\332=\260\370TC\364\252\037kdG\010\272\330Cwaq\373\006\354\001\264\006\272,\251\201\007~\210\365\266\236\302i\261\314E\233\277\263{k\325\324Q\333?\003$\202\017\374\271\035\302\237\224\360\014\215\343I\370[\253\007L\276\276\377\332^\377\325\376\225?\010\301>\035K\306s\322\320\2702~l\016\202I\362\255_\354\367\353\300\362 \004#.\366\t\224\272v\2771\262\327\215&\034\247{J\273\007\213\337\325\311F\n\362\205W:\022\253(;^\200*\212\035\302$m]C%\324\276\376\240\361\2449\326\032\351\204!E\324\356\3014I\022\0149yH\323\323\246\317\335\007= \324\206~\362L\363Yk\323^^i\367\220\036\222\036\375\300\264\377\250>\301\203\214\037\233){j\315^\333\2607\304v\017l\210\223\206NB\316M5G|C\241q\26030\256l\227\267:\016\275\337\030k\2164\375R\241\311\263_d\355\254fkz\307\241\343,\017yC\2376\273\355\037W\354\225\337\354\337\204\216Co\262F\310\033\nKg?x\331R\354\265\017\035G\336\255?\305\263:\337\310\251\346\210\375\354\243\375\021T\226:\016\275\005\205 C}\227\r\205^\334~\370j\377,l\207:\216\274W\377\204\301\356\033\371\274\231\261\247\177\266\177.\330\005\271\343\320\333\254\014{C\0375\226\355\307o\366\227\354\237\177\3510\262\372\014*\270P\363\017\244uei\177\244\243\300\321\332.\351\276\274q\217\033\202\375di_\261\377\361O6\262\335""\323k\367\336\250\335\256w\327S^\230M\241#4_B\335~\204-\316\376m\014\255\345\025z\200\003ch\201\025\376\013j\223\221Z";
    PyObject *data = __Pyx_DecompressString(cstring, 7015, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (22069 bytes) */
const char* const bytes = ": A TLS certificate and key for use in Flight.A type of action that is executable on a Flight service.A write operation exceeded the client-configured limit.Action must be Action instance, string, or tupleArgument app_metadata must be a string or bytes, not 'Argument expiration_time must be a TimestampScalar, not 'Argument locations must contain Location instances, strings or bytes, not 'Argument ticket must be a Ticket instance, string or bytes, not 'Can only provide TracingServerMiddlewareFactory onceCan only return metadata alongside a RecordBatch.Can't construct RecordBatchStream from type Cannot use ClientAuthReader outside ClientAuthHandler.authenticateCannot use ClientAuthSender outside ClientAuthHandler.authenticateCannot use ServerAuthReader outside ServerAuthHandler.authenticateCannot use ServerAuthSender outside ServerAuthHandler.authenticateDo not call Endpoint \nExpected: Expected RecordBatchReader or Table, but got: Expected a FlightCallOptions object, not 'FlightClient.authenticate takes a ClientAuthHandler, not 'FlightServerBase.do_get must return a FlightDataStreamFlightServerBase.get_flight_info must return a FlightInfo instance, but got FlightServerBase.get_schema_info must return a SchemaResult instance, but got FlightServerBase.list_flights must return FlightInfo instances, but got <FlightStreamChunk with data: Flight RPC failed with Python exception \"Flight RPC failed with message: (.*). Detail: Python exception: (.*)Flight error: GeneratorStream must be initialized with an iterator of FlightDataStream, Table, RecordBatch, or RecordBatchStreamReader objects, not Got a FlightDataStream whose schema does not match the declared schema of this GeneratorStream. Got: Got a RecordBatch whose schema does not match the declared schema of this GeneratorStream. Got: Information about a particular RPC for Flight middleware.Invalid descriptor type!Middleware key cannot be Must provide Action, not 'Must provide a FlightDescriptor, not 'Must provide a Locati""on, not '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.Operation on closed readerResults of list_actions must be ActionType or tupleState for an async RPC using asyncio.The 'FlightClient.connect' method is deprecated, use FlightClient constructor or pyarrow.flight.connect function insteadThe 'FlightServer.run' method is deprecated, use FlightServer.serve method insteadThe implemented methods in Flight.The parameter chunksize is deprecated for the write_table methods as of 0.15, please use parameter max_chunksize instead\n    The type of a FlightDescriptor.\n\n    Attributes\n    ----------\n\n    UNKNOWN\n        An unknown descriptor type.\n\n    PATH\n        A Flight stream represented by a path.\n\n    CMD\n        A Flight stream represented by an application-defined command.\n\n    While getting next payload, ran out of attempts to get something to send (application server implementation error)\"'\n>>)>.?add_note app_metadata=auth_handler must be a ServerAuthHandler, not a '-bin body=( bytes)> descriptor=disableenable endpoints=expected IpcReadOptions, got  expiration_time=gc headers= is not instance of FlightEndpointisenabled`location` argument must be a string, tuple or a Location instance locations= ordered= password=(redacted)>pyarrow/_flight.pyx<pyarrow.flight.Action type=<pyarrow.flight.BasicAuth username=<pyarrow.flight.FlightCallOptions timeout=<pyarrow.flight.FlightDescriptor path=<pyarrow.flight.FlightDescriptor cmd=<pyarrow.flight.FlightDescriptor UNKNOWN><pyarrow.flight.FlightEndpoint ticket=<pyarrow.flight.FlightInfo schema=<pyarrow.flight.Location <pyarrow.flight.Result body=(<pyarrow.flight.SchemaResult schema=(<pyarrow.flight.Ticket ticket=\n read_options=run() on uninitialized FlightServerBase's constructor directly, use `pyarrow.flight.FlightDescriptor.for_{path,command}` function instead.self.action cannot be c""onverted to a Python object for picklingself.basic_auth cannot be converted to a Python object for picklingself.c_options,self.current_stream,self.schema cannot be converted to a Python object for picklingself.c_ticket cannot be converted to a Python object for picklingself.chunk cannot be converted to a Python object for picklingself.client cannot be converted to a Python object for picklingself.context cannot be converted to a Python object for picklingself.descriptor cannot be converted to a Python object for picklingself.endpoint cannot be converted to a Python object for picklingself.info cannot be converted to a Python object for picklingself.location cannot be converted to a Python object for picklingself object in callback is not GeneratorStreamself.options cannot be converted to a Python object for picklingself.reader cannot be converted to a Python object for picklingself.result cannot be converted to a Python object for picklingself.sender cannot be converted to a Python object for picklingself.server cannot be converted to a Python object for picklingself.write_options cannot be converted to a Python object for picklingself.writer cannot be converted to a Python object for picklingshutdown() on uninitialized FlightServerBase total_bytes= total_records=(tree fragment) with metadata: \n write_options=ActionActionType_ActionTypeActionType.make_actionAction.__reduce_cython__Action.__setstate_cython__Action.deserializeAction.serializeArrowCancelledArrowExceptionArrowInvalidAsyncioCallAsyncioCall.__init__AsyncioCall.as_awaitableAsyncioCall.wakeupAsyncioFlightClientAsyncioFlightClient.__reduce_cython__AsyncioFlightClient.__setstate_cython__AsyncioFlightClient.get_flight_infoBasicAuthBasicAuth.__reduce_cython__BasicAuth.__setstate_cython__BasicAuth.deserializeBasicAuth.serializeCMDCallInfo_CallInfo_CertKeyPairCertKeyPairClientAuthHandlerClientAuthHandler.__reduce_cython__ClientAuthHandler.__setstate_cython__ClientAuthHandler.authenticateClientAuthHandler.get_tok""enClientAuthReaderClientAuthReader.__reduce_cython__ClientAuthReader.__setstate_cython__ClientAuthReader.readClientAuthSenderClientAuthSender.__reduce_cython__ClientAuthSender.__setstate_cython__ClientAuthSender.writeClientMiddlewareClientMiddlewareFactoryClientMiddlewareFactory.__reduce_cython__ClientMiddlewareFactory.__setstate_cython__ClientMiddlewareFactory.start_callClientMiddleware.__reduce_cython__ClientMiddleware.__setstate_cython__ClientMiddleware.call_completedClientMiddleware.received_headersClientMiddleware.sending_headersDOTALLDO_ACTIONDO_EXCHANGEDO_GETDO_PUTDescriptorTypeEnum_FLIGHT_SERVER_ERROR_REGEXFalseFlightCallOptionsFlightCallOptions.__reduce_cython__FlightCallOptions.__setstate_cython__FlightCancelledErrorFlightCancelledError.__reduce_cython__FlightCancelledError.__setstate_cython__FlightClientFlightClient.__enter__FlightClient.__exit__FlightClient.__reduce_cython__FlightClient.__setstate_cython__FlightClient.as_asyncFlightClient.authenticateFlightClient.authenticate_basic_tokenFlightClient.closeFlightClient.connectFlightClient.do_actionFlightClient.do_exchangeFlightClient.do_getFlightClient.do_putFlightClient.get_flight_infoFlightClient.get_schemaFlightClient.list_actionsFlightClient.list_flightsFlightClient.wait_for_availableFlightDataStreamFlightDataStream.__reduce_cython__FlightDataStream.__setstate_cython__FlightDescriptorFlightDescriptor.__reduce_cython__FlightDescriptor.__setstate_cython__FlightDescriptor.deserializeFlightDescriptor.for_commandFlightDescriptor.for_pathFlightDescriptor.serializeFlightEndpointFlightEndpoint.__reduce_cython__FlightEndpoint.__setstate_cython__FlightEndpoint.deserializeFlightEndpoint.serializeFlightErrorFlightError.__reduce_cython__FlightError.__setstate_cython__FlightInfoFlightInfo.__reduce_cython__FlightInfo.__setstate_cython__FlightInfo.deserializeFlightInfo.serializeFlightInternalErrorFlightInternalError.__reduce_cython__FlightInternalError.__setstate_cython__FlightMetadataReaderFlightMetadataReader.__redu""ce_cython__FlightMetadataReader.__setstate_cython__FlightMetadataReader.readFlightMetadataWriterFlightMetadataWriter.__reduce_cython__FlightMetadataWriter.__setstate_cython__FlightMetadataWriter.writeFlightMethodFlightServerBaseFlightServerBase.__enter__FlightServerBase.__exit__FlightServerBase.__reduce_cython__FlightServerBase.__setstate_cython__FlightServerBase.do_actionFlightServerBase.do_exchangeFlightServerBase.do_getFlightServerBase.do_putFlightServerBase.get_flight_infoFlightServerBase.get_schemaFlightServerBase.list_actionsFlightServerBase.list_flightsFlightServerBase.runFlightServerBase.serveFlightServerBase.shutdownFlightServerBase.waitFlightServerErrorFlightServerError.__reduce_cython__FlightServerError.__setstate_cython___FlightServerFinalizer_FlightServerFinalizer.__reduce_cython___FlightServerFinalizer.__setstate_cython___FlightServerFinalizer.finalizeFlightStreamChunkFlightStreamChunk.__reduce_cython__FlightStreamChunk.__setstate_cython__FlightStreamReaderFlightStreamReader.__reduce_cython__FlightStreamReader.__setstate_cython__FlightStreamReader.cancelFlightStreamReader.read_allFlightStreamWriterFlightStreamWriter.__reduce_cython__FlightStreamWriter.__setstate_cython__FlightStreamWriter.done_writingFlightTimedOutErrorFlightTimedOutError.__reduce_cython__FlightTimedOutError.__setstate_cython__FlightUnauthenticatedErrorFlightUnauthenticatedError.__reduce_cython__FlightUnauthenticatedError.__setstate_cython__FlightUnauthorizedErrorFlightUnauthorizedError.__reduce_cython__FlightUnauthorizedError.__setstate_cython__FlightUnavailableErrorFlightUnavailableError.__reduce_cython__FlightUnavailableError.__setstate_cython__FlightWriteSizeExceededErrorFlightWriteSizeExceededError.__init__GET_FLIGHT_INFOGET_SCHEMAGeneratorStreamGeneratorStream.__reduce_cython__GeneratorStream.__setstate_cython__HANDSHAKEINVALIDLIST_ACTIONSLIST_FLIGHTSLocationLocation.__reduce_cython__Location.__setstate_cython__Location.equalsLocation.for_grpc_tcpLocation.for_grpc_tlsLocation.for""_grpc_unix_MetadataRecordBatchReaderMetadataRecordBatchReader_MetadataRecordBatchReader.__reduce_cython__MetadataRecordBatchReader.__reduce_cython___MetadataRecordBatchReader.__setstate_cython__MetadataRecordBatchReader.__setstate_cython___MetadataRecordBatchReader.read_all_MetadataRecordBatchReader.read_chunk_MetadataRecordBatchReader.to_readerMetadataRecordBatchWriterMetadataRecordBatchWriter.__reduce_cython__MetadataRecordBatchWriter.__setstate_cython__MetadataRecordBatchWriter.beginMetadataRecordBatchWriter.closeMetadataRecordBatchWriter.write_metadataMetadataRecordBatchWriter.write_batchMetadataRecordBatchWriter.write_tableMetadataRecordBatchWriter.write_with_metadataNoneNotImplementedPATH__Pyx_PyDict_NextRef_ReadPandasMixinRecordBatchStreamRecordBatchStream.__reduce_cython__RecordBatchStream.__setstate_cython__ResultResult.__reduce_cython__Result.__setstate_cython__Result.deserializeResult.serializeSchemaSchemaResultSchemaResult.__reduce_cython__SchemaResult.__setstate_cython__SchemaResult.deserializeSchemaResult.serializeServerAuthHandlerServerAuthHandler.__reduce_cython__ServerAuthHandler.__setstate_cython__ServerAuthHandler.authenticateServerAuthHandler.is_validServerAuthReaderServerAuthReader.__reduce_cython__ServerAuthReader.__setstate_cython__ServerAuthReader.readServerAuthSenderServerAuthSender.__reduce_cython__ServerAuthSender.__setstate_cython__ServerAuthSender.writeServerCallContextServerCallContext.__reduce_cython__ServerCallContext.__setstate_cython__ServerCallContext.add_headerServerCallContext.add_trailerServerCallContext.get_middlewareServerCallContext.is_cancelledServerCallContext.peerServerCallContext.peer_identityServerMiddlewareServerMiddlewareFactory_ServerMiddlewareFactoryWrapper_ServerMiddlewareFactoryWrapper.start_call_ServerMiddlewareFactoryWrapper.__reduce_cython___ServerMiddlewareFactoryWrapper.__setstate_cython__ServerMiddlewareFactory.__reduce_cython__ServerMiddlewareFactory.__setstate_cython__ServerMiddlewareFactory.start_call_Serv""erMiddlewareWrapper_ServerMiddlewareWrapper.__reduce_cython___ServerMiddlewareWrapper.__setstate_cython___ServerMiddlewareWrapper.call_completed_ServerMiddlewareWrapper.sending_headersServerMiddleware.__reduce_cython__ServerMiddleware.__setstate_cython__ServerMiddleware.call_completedServerMiddleware.sending_headersSignalStopHandlerTableTicketTicket.__reduce_cython__Ticket.__setstate_cython__Ticket.deserializeTicket.serializeTimestampScalarTracingServerMiddlewareTracingServerMiddlewareFactoryTracingServerMiddlewareFactory.__reduce_cython__TracingServerMiddlewareFactory.__setstate_cython__TracingServerMiddleware.__init__TrueUNKNOWNUTCactionaction_typeactualadd_headeradd_trailerapp_metadataappendas_asyncas_awaitableas_bufferasciiasyncioasyncio.coroutinesauthauth_handlerauthenticateauthenticate_basic_token__await__batchbeginbodybufbytesc_actionc_bufc_criteriac_descriptorc_do_exchange_resultc_do_put_resultc_hostc_max_chunksizec_messagec_middlewarec_optionsc_pathc_portc_schemac_tablec_trace_contextcallcall_completedcall_soon_threadsafecancelcastcertcert_chainchunkchunksize__class____class_getitem__clientcline_in_tracebackcloseclscollectionscommandcompileconnectcontextcreate_futurecriteriacustom_metadatadatadata_sourcedeadlinedecodedefaultdictdescriptiondescriptordescriptor_typedeserialize__dict___dictdisable_server_verificationdo_actiondo_action.<locals>._do_action_response_do_action_responsedo_exchangedo_getdo_put__doc__done_writingencodeendpointendpointsendswith__enter__enumequalsexc_typeexc_valueexception__exit__expiration_timeextendextra_infofactoriesfactoryfinalizefor_commandfor_grpc_tcpfor_grpc_tlsfor_grpc_unixfor_pathfrombytes__func___futuregeneratorgeneric_optionsgetget_flight_info_get_legacy_format_defaultget_loopget_middlewareget_running_loopget_schemaget_token__getstate__grouphandlerheadershostincominginfo__init__instanceinstancesis_cancelled_is_coroutineis_validitemskeykwargsliblimitlist_actionslist_flightslistinglocalhostlocationlocationslooplowerm__main__ma""ke_actionmatchmax_chunksizemessage__metaclass__methodmiddleware__module__more_headers__mro_entries__msg_munge_grpc_python_error__name__namedtuple__new__nextnsobjectoptionsorderedotheroutgoingoverride_hostnameppairpasswordpathpeerpeer_identitypopport__prepare__private_keypwpy_actionpy_middlewarepy_readerpy_writerpyarrow._flightpyarrow.ipcpyarrow.lib__pyx_checksum__pyx_result__pyx_state__pyx_type__pyx_unpickle_AsyncioFlightClient__pyx_unpickle_ClientAuthHandler__pyx_unpickle_ClientMiddleware__pyx_unpickle_ClientMiddlewareFactory__pyx_unpickle_FlightCancelledError__pyx_unpickle_FlightDataStream__pyx_unpickle_FlightError__pyx_unpickle_FlightInternalError__pyx_unpickle_FlightServerError__pyx_unpickle_FlightTimedOutError__pyx_unpickle_FlightUnauthenticatedError__pyx_unpickle_FlightUnauthorizedError__pyx_unpickle_FlightUnavailableError__pyx_unpickle_ServerAuthHandler__pyx_unpickle_ServerMiddleware__pyx_unpickle_ServerMiddlewareFactory__pyx_unpickle_TracingServerMiddlewareFactory__pyx_unpickle__ServerMiddlewareFactoryWrapper__pyx_unpickle__ServerMiddlewareWrapper__pyx_vtable____qualname__rereadread_allread_chunkread_optionsreaderreceived_headers__reduce____reduce_cython____reduce_ex__resultresult_or_exceptionresultsreturnroot_certificatesrunsafescalarschemaselfsendsending_headersserializeserializedserveserverset_exception__set_name__set_resultsetdefault__setstate____setstate_cython__shutdownsizesleep__slots__start_callstatestaticmethodstatusstop_handlerstop_tokensupertable__test__throwtickettimetimeouttimestamptls_certificatestls_root_certsto_readertobytestokentotal_bytestotal_recordstrace_contexttracebacktypeupdateuriuse_setstateuserusernamevaluevaluesverify_clientwaitwait_for_availablewakeupwarnwarningsweakrefwrapperwritewrite_batchwrite_metadatawrite_optionswrite_size_limit_byteswrite_tablewrite_with_metadatawriterPyObject *( arrow::ipc::ReadStats)\000PyObject *(std::shared_ptr< arrow::Buffer>  const &)\000PyObject *(std::shared_ptr< arrow::RecordBatch>  const &)\000PyOb""ject *(std::shared_ptr< arrow::Schema>  const &)\000PyObject *(std::shared_ptr< arrow::Table>  const &)\000int (arrow::Status const &)\000std::shared_ptr< arrow::Buffer>  (PyObject *)\000std::shared_ptr< arrow::Schema>  (PyObject *)\000struct __pyx_obj_7pyarrow_3lib_IpcReadOptions *( arrow::ipc::IpcReadOptions)\000struct __pyx_obj_7pyarrow_3lib_IpcWriteOptions *( arrow::ipc::IpcWriteOptions)\000_wrap_read_stats\000pyarrow_wrap_buffer\000pyarrow_wrap_batch\000pyarrow_wrap_schema\000pyarrow_wrap_table\000check_status\000pyarrow_unwrap_buffer\000pyarrow_unwrap_schema\000wrap_ipc_read_options\000wrap_ipc_write_options\200\001\330\0041\260\021\260&\270\001\320\0042\3202F\300a\360\030\000\r>\270W\300A\300Q\340\010\013\2104\210z\230\021\230.\250\001\330\014\022\220)\2301\330\020L\310A\310T\320QR\320RS\330\010\017\210v\220R\320\027+\250=\270\013\3001\330\r\016\330\014\037\230q\330\020\024\220G\2304\230r\240\035\250a\250v\260Q\330/3\2601\260A\200\001\330\0042\260!\2606\270\021\320\0042\260!\330\027\030\360$\000\t\017\210a\200\001\330\0044\260A\260V\2701\320\004)\250\021\360\020\000\t\024\2204\220u\230C\230r\240\021\330\010\t\330\014\r\330\020\024\220A\220T\230\035\240a\330\023\024\330\020\023\2204\220u\230C\230r\240\021\330\024\030\230\006\230a\230q\330\024\025\340\024\025\330\023\024\360\006\000\021\022\340\020\021\320\004*\250!\330!5\260Q\360\006\000\r!\240\n\250(\260!\2601\330\014=\270W\300A\300Q\330\014\r\330 '\240q\250\001\340\r\016\330\014\037\230q\240\004\240G\2504\250r\260\036\270q\330\020\026\220l\240-\250v\260Q\260a\260v\270Q\340\010\017\210q\320\0045\260Q\360\032\000\r(\240q\340\010\013\210<\220s\230!\330\014\034\230F\240!\2401\330\014\023\2201\360\006\000\r\025\220E\230\021\230%\230q\340\010\013\210>\230\027\240\001\330\014\036\230a\340\r\016\330\014\037\230q\330\020\024\220H\230B\230k\250\021\250%\250v\260Q\260d\270!\200\001\330\0045\260Q\260f\270A\200\001\330\0046\260a\260v\270Q\320\004$\320$8\270\001\360\010\000\r>\270W\300A\300Q\340\r\036\230f\240A\330\014""\025\220Q\330\021\035\230\\\250\034\260Q\330\021\022\330\020#\2401\330\024\030\230\007\230t\2402\240\\\260\021\260&\270\013\3006\310\021\310!\3101\340\014\025\220Q\330\014\020\220\017\230q\330\020\034\230J\240a\240y\260\001\260\033\270A\330'0\260\001\260\033\270A\330\020\026\220g\230Q\230a\340\014\023\2201\200\001\330\0048\270\001\270\026\270q\200A\320\004\032\230!\330\010\024\220A\220T\230\027\240\004\240B\320&8\270\001\330\010\017\320\017\"\240!\2401\200\001\330\004<\270A\270V\3001\200A\360\016\000\t\n\330\014!\240\021\240)\2501\250A\330\r\016\330\014\037\230q\240\004\240G\2504\250r\260\036\270q\300\006\300a\200A\360\024\000\t\022\320\021\"\240(\250!\2501\330\r\016\330\014\022\220*\230N\250!\320+@\300\001\300\024\300Q\340\010\017\210q\200A\330\010\013\2104\210q\330\014\020\220\n\230!\200A\340\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\340\r\016\330\014\037\230q\240\004\240G\2505\260\001\260\021\260!\330\010\017\210q\200A\330\010\"\240'\250\021\250!\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\340\r\016\330\014\037\230q\240\004\240G\2506\260\021\260!\200A\360\034\000\t\014\2104\210w\220d\230#\230S\240\001\330\014\022\220*\230A\230Q\330\r\016\330\014\037\230q\240\004\240G\2504\250r\260\031\270!\200A\360\014\000\t\014\2104\210w\220d\230#\230S\240\001\330\014\022\220*\230A\230Q\330\r\016\330\014\037\230q\240\004\240G\2504\250r\3201B\300!\200A\360\034\000\r'\320&7\260q\340\r\016\330\014\037\230q\240\004\240G\2504\250r\260\025\260b\270\006\270a\270q\300\005\300Q\340\010\013\2105\220\006\220f\230C\230u\240D\250\005\250V\260>\300\023\300A\330\014\022\220!\340\010\017\210q\200A\330\010\024\220A\330\010\014\210E\220\033\230D\240\n\250&\260\001\330\014\027\220w\230k\250\021\250&\260\001\330\014\017\210q\330\020\031\230\021\230'\240\021\330\010\013\2101\330\014\026\320\026.\250a\250q\330\014\023\2201\330\010\017\210q\200A\340\r\016\330\r$\240D\250\007\250t\2603\260g\270Q\200A\330\010\014\210F\220!\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,""\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0171\260\024\260Q\260g\270[\310\007\310q\340\010\017\320\0171\260\024\260Q\260g\270[\310\001\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0172\260$\260a\260w\270k\310\027\320PQ\340\010\017\320\0172\260$\260a\260w\270k\310\021\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0174\260D\270\001\270\027\300\013\3107\320RS\340\010\017\320\0174\260D\270\001\270\027\300\013\3101\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\017;\2704\270q\300\007\300{\320RY\320YZ\340\010\017\320\017;\2704\270q\300\007\300{\320RS\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0175\260T\270\021\270'\300\033\310G\320ST\340\010\017\320\0175\260T\270\021\270'\300\033\310A\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0177\260t\2701\270G\300;\310g\320UV\340\010\017\320\0177\260t\2701\270G\300;\310a\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\0178\270\004\270A\270W\300K\310w\320VW\340\010\017\320\0178\270\004\270A\270W\300K\310q\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007""\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\017,\250D\260\001\260\027\270\013\3007\310!\340\010\017\320\017,\250D\260\001\260\027\270\013\3001\200\001\360\010\000\005\r\210A\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220q\330\004\007\200q\330\010\017\320\017?\270t\3001\300G\310;\320V]\320]^\340\010\017\320\017?\270t\3001\300G\310;\320VW\200A\360\020\000\t\n\330\014\034\230H\240A\240Q\330\010\022\220.\240\016\250a\330\035)\250\021\250'\260\021\260!\330\010\017\210q\200A\360\006\000\t\n\330\014\034\230H\240A\240Q\330\010\016\210k\230\030\240\021\330\010\016\210k\230\030\240\021\240'\250\021\250#\250T\260\025\260a\330\010\017\210q\200A\360\006\000\t\n\330\014\034\230H\240A\240Q\330\010\016\210k\230\030\240\021\330\010\016\210k\230\027\240\007\240q\250\001\330\010\017\210q\200A\340\010\014\210H\220J\230a\230w\240a\240v\250W\260A\260Q\200A\340\010\014\210H\220K\230q\240\007\240q\250\006\250g\260Q\260a\200A\360\016\000\r\016\330\020\024\220H\230N\250!\2501\360\006\000\t\014\210=\230\003\2301\330\014\033\2304\230x\240~\260Q\260g\270Q\270a\340\010\013\210=\230\003\2301\330\014\023\2201\330\r\031\230\025\230c\240\023\240A\330\014\031\320\0310\260\001\330\014\034\320\0347\260z\300\032\3101\330\014\023\220=\240\013\2504\250q\260\001\330\r\031\230\025\230c\240\023\240A\330\014\037\320\037;\2701\330 0\260\001\330\014\034\230A\230T\240\026\240t\2507\260$\260h\270a\330\014\023\320\023*\250!\2501\330\010\017\210q\200A\330\010\022\220+\230\\\250\021\250!\330\010\014\210L\230\004\230K\240w\250a\330\014\033\2308\320#3\2601\330\014\017\210t\2201\330\020\021\360\006\000\r\021\220\005\220Z\230|\2506\260\021\340\020\026\220c\230\026\230q\330\020\023\220:\230Q\230i\240w\250a\330\024\036\230a\330\020\027\220q\230\004\230G\2401\240A\330\010\017\210q\200A\330\010\014\210L\230\004\230K\240w\250a\330\014\024\220O\2401\240A\200A\330\010\014\320\014""\035\230Q\200A\360\014\000\t\021\220\005\220Q\220a\340\010\014\210F\220!\200A\360\016\000\t\020\210~\230Q\230d\240'\320);\2701\200A\360\016\000\t\020\210~\230Q\230d\240)\320+=\270Q\200A\360\016\000\t\020\210~\230Q\230d\240'\250\024\250R\320/A\300\021\200A\330\010\017\210~\230Q\230d\240+\250T\260\022\3203E\300Q\200A\360\016\000\t\020\210~\230Q\230d\240+\320-?\270q\200A\360\016\000\t\020\210~\230Q\230d\240%\240t\2502\320-?\270q\320\004\034\320\034,\250A\360\006\000\r,\320+@\300\001\300\021\330\014)\250\034\260Q\260h\270a\330\r\016\330\014\037\230q\240\004\240H\250B\250f\260A\260Z\270q\200A\330\010\r\210R\210y\230\001\230\021\330\010\014\210I\220Q\330\010\014\210J\220a\200A\340\014%\240T\250\027\260\004\260A\340\010\013\2107\220#\220Q\330\014\r\330\010\t\330\021\022\330\020\031\230\026\230y\250\001\330\020\023\2206\230\023\230A\330\024\035\230V\2405\250\001\330\014\037\230q\240\001\340\014\020\220\007\220v\230Q\200A\360\020\000\t\036\230V\2408\2501\250A\330\010\016\210g\220V\2301\320\034-\250Q\250n\270A\330\031%\240Q\240g\250Q\250a\330\010\017\210q\200A\360\020\000\t\036\230V\2408\2501\250A\330\010\016\210j\230\016\240a\330\023\037\230q\240\007\240q\250\001\330\010\017\210q\200A\360\020\000\t\036\230V\2408\2501\250A\330\010\016\210l\230.\250\001\330\023\037\230q\240\007\240q\250\001\330\010\017\210q\320\004!\240\021\330\030,\250A\360\022\000\r,\320+@\300\001\300\021\340\014=\270W\300A\300Q\330\014\r\330 '\240q\250\001\340\r\016\330\014\037\230q\240\004\240G\2504\250r\260\026\260q\330\020\026\220a\330\020\021\330\020\031\230\026\230q\240\001\240\021\330\010\024\320\024&\240a\330\010\021\220\027\230\006\230a\230\177\250g\260X\270Q\330\010\024\320\024(\250\001\330\010\021\220\027\230\006\230a\230\177\250g\260X\270Q\330\010\017\210{\230!\200A\340\010\021\220\024\220W\230D\240\001\330\010\013\2107\220#\220Q\330\014\037\230q\240\006\240f\250A\200A\360\020\000\t(\240~\260X\270Q\270a\330\010\020\220\014\230N\250!\330\033'\240q\250\007\250q\260\001\330\010\017\210q\200A\360""\030\000\t\017\210a\200A\360\032\000\t\017\210a\200A\360\024\000\t\017\210a\200A\340\010\016\210a\200A\360$\000\t\017\210a\200A\360&\000\t\017\210a\200A\360 \000\t\017\210a\200A\360(\000\t\017\210a\200A\330*>\270a\360(\000\r>\270W\300A\300Q\330\014\034\230G\2401\240A\330\014\032\230'\240\021\240!\340\r\016\330\014\025\220T\230\027\240\004\240B\320&=\270Q\270f\300A\330>D\300A\330\014\037\230q\240\006\240g\250Q\340\010\017\210~\230Q\230a\200A\360\026\000\t*\320)>\270a\270y\310\001\310\021\330\r\016\330\014\037\230q\330\020\024\220H\230B\320\0360\260\001\260\026\260u\270I\300Q\200A\340\010)\320)>\270a\270y\310\001\310\021\330\r\016\330\014\037\230q\330\020\024\220H\230B\230n\250A\250Q\200A\360\n\000\016\037\230f\240A\330\014\032\230,\240l\260,\270a\330\021\022\330\020#\2401\330\025,\250D\260\007\260t\2701\330\024)\250\021\250+\260V\2701\270A\270Q\330\010\017\320\017!\240\021\240!\200A\360\010\000\r\037\230g\240Q\240a\330\014\031\230\021\330\014\036\230h\240h\250a\250q\330\010\033\2301\330\025 \240\001\240\030\250\027\260\006\260a\260q\270\006\270a\330\010\017\210q\200A\360\010\000\r\037\230g\240Q\240a\330\014\036\230h\240h\250a\250q\330\010\033\230:\240\\\260\021\260'\270\026\270q\300\001\300\026\300q\330\010\017\210q\200A\330\010\017\210q\200A\330.?\270q\330\0344\260A\330,-\360\014\000\t\021\220\005\220Q\220a\360\006\000\t\020\210|\2301\330\014\026\220o\240Q\330\014\027\220|\240<\250q\330\014\036\230a\330\014(\250\001\200A\360\010\000\016\017\330\014\037\230q\240\004\240G\2504\250r\260\030\270\022\2706\300\021\300!\3001\330\010\017\320\017!\240\021\240!\200A\360\006\000\016\017\330\014\037\230q\240\004\240G\2504\250r\260\035\270a\270q\300\001\330\010\013\2104\210s\220!\330\014\023\2201\330\010\017\320\017\"\240!\2401\200A\340\r\016\330\014\037\230q\330\021(\250\004\250G\2604\260s\270,\300a\200A\360\"\000\016\017\330\014\037\230q\330\020\024\220H\230B\320\036/\250q\260\006\260e\2709\300A\200A\360\010\000\016\017\330\014\037\230q\240\004\240H\250B\250f\260A\200A\340""\r\016\330\014\020\220\007\220t\2302\230U\240!\200A\340\010\017\210t\2208\230=\250\001\200A\330\010\017\210u\220C\220q\200A\360\020\000\t\020\210v\220Q\220d\230'\240\021\200A\360\n\000\t\020\210w\220a\220t\2308\240>\260\021\200A\360\020\000\t$\240<\250x\260q\270\001\330\010\016\210g\220V\2301\320\034-\250Q\250n\270A\330\031%\240Q\240g\250Q\250a\330\010\017\210q\200A\340\010\017\210y\230\001\330\010\014\210K\220v\230Q\230n\250A\250^\2701\330\026\"\240!\2407\250!\2501\330\010\017\210q\200A\360\006\000\t\020\210y\230\001\230\024\230X\240U\250$\250e\2601\200A\360\020\000\t \230z\250\030\260\021\260!\330\010\014\210H\220D\230\001\230\036\240q\330\027#\2401\240G\2501\250A\330\010\017\210q\320\004\035\320\035.\320.B\300!\360\022\000\r>\270W\300A\300Q\340\r\016\330\014\037\230q\330\020\024\220G\2304\230r\240\026\240q\330\024\032\230,\240f\250J\260f\270A\270Q\270a\330\010\021\320\021#\2401\330\010\016\210g\220V\2301\230F\240(\250!\330\010\017\210q\200\001\360H\001\000\005\014\210<\220q\230\014\240A\320\004\032\230!\330\017\020\330\010\014\210K\220w\320\036/\250r\260\036\270q\210!\340\024\025\340\021%\240Q\320\004%\240Q\330\0340\260\001\360\006\000\r#\240,\250h\260a\260q\330\014=\270W\300A\300Q\330\014\r\330 '\240q\250\001\330\r\016\330\014\030\230\001\330\020\024\220G\2304\230q\330\024\036\230a\230v\240\\\260\035\270f\300A\300Q\300f\310A\360\006\000\t\020\210q\200\001\330\004\n\210+\220Q\320\004)\320)=\270Q\360$\000\r>\270W\300A\300Q\340\010\013\210:\220Q\220i\230u\240A\330\014\025\220V\2301\230H\240A\330\r\027\220q\230\010\240\001\330\014\025\220V\2302\230Q\330\r\021\220\032\2301\230H\240A\330\014\022\220)\2301\230A\340\010&\240g\250Q\250i\260q\330\r\016\330\014\037\230q\330\020\024\220G\2304\230r\240\031\250!\330\024\032\230,\240i\250v\260Q\260a\260q\340\010\t\360\024\000\t\020\320\017\"\240!\320\004-\250Q\360\006\000\t\020\210t\2208\2309\240A\330\010\013\210:\220Q\320\026+\2501\330\014\020\320\020%\240Q\330\020\024\220H\320\034,\250A\340\014\020\320\020%\240Q\330\020\024""\220H\230M\250\021\200\001\330\004=\270Q\270f\300A\200\001\360\010\000\005\016\210T\220\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\2309\240G\2501\330\004\007\200q\330\010\017\320\0174\260D\270\001\270\027\300\013\3107\320RS\340\010\017\320\0174\260D\270\001\270\027\300\013\3101\200\001\360\010\000\005\016\210T\220\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\230;\240g\250Q\330\004\007\200q\330\010\017\320\017@\300\004\300A\300W\310K\320W^\320^_\340\010\017\320\017@\300\004\300A\300W\310K\320WX\200\001\360\010\000\005\016\210T\220\021\330\004\014\210G\2201\220F\230,\240a\330\004\007\200v\210W\220E\230\024\230Q\330\010\022\220!\330\010\027\220q\340\010\027\220t\230<\240w\250a\330\004\007\200q\330\010\017\320\0179\270\024\270Q\270g\300[\320PW\320WX\340\010\017\320\0179\270\024\270Q\270g\300[\320PQ\320\004%\240X\250Q\330\0362\260!\210\001\200\001\330\004)\250\021\250&\260\001\320\004&\240a\330\0351\260\021\360\"\000\r>\270W\300A\300Q\330\014\r\330 '\240q\250\001\340\r\016\330\014\037\230q\240\004\240G\2504\250r\260\033\270A\330\020\026\220a\330\020\035\230V\2401\240A\240Q\330\010\024\320\024&\240a\330\010\021\220\027\230\006\230a\320\0373\2607\270(\300!\330\010\024\320\024&\240a\330\010\021\220\027\230\006\230a\320\0373\2607\270(\300!\330\010\017\210{\230!\320\004\036\230a\330\010\017\210t\2201\200\001\330\004.\250a\250v\260Q\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023*\250(\260!\2601\330\004\007\200|\2207\230!\330\0109\270\021\320:T\320Tb\320bc\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\0231\260\030\270\021\270!\330\004\007\200|\2207\230!\330\010@\300\001\320Ab\320bp\320pq\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\0232\260(\270!\2701\330\004\007\200|\2207\230!\330\010A\300""\021\320Bd\320dr\320rs\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023)\250\030\260\021\260!\330\004\007\200|\2207\230!\330\0108\270\001\3209R\320R`\320`a\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023#\2408\2501\250A\330\004\007\200|\2207\230!\330\0102\260!\3203F\300n\320TU\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023+\2508\2601\260A\330\004\007\200|\2207\230!\330\010:\270!\320;V\320Vd\320de\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023$\240H\250A\250Q\330\004\007\200|\2207\230!\330\0103\2601\3204H\310\016\320VW\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023-\250X\260Q\260a\330\004\007\200|\2207\230!\330\010<\270A\320=Z\320Zh\320hi\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023&\240h\250a\250q\330\004\007\200|\2207\230!\330\0105\260Q\3206L\310N\320Z[\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\220;\230h\240a\240q\330\004\007\200|\2207\230!\330\010-\250Q\250n\270N\310!\330\004\013\2101\200\001\340\004\037\230q\320 0\260\013\270;\300k\320QR\330\004\023\320\023'\240x\250q\260\001\330\004\007\200|\2207\230!\330\0106\260a\3207N\310n\320\\]\330\004\013\2101\200\001\330\004\010\320\010\"\240&\250\001\250\021\330\004\007\200q\330\010\017\320\017:\270!\2701\270F\300!\3005\310\001\310\021\310&\320PQ\320QR\340\010\017\210q\200\001\330\004/\250q\260\006\260a";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 692; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 118) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 692; i < 815; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 815; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 692;
      for (Py_ssize_t i=0; i<123; ++i) {
        #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
        }
        #else
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
    double const c_constants[] = {0.025};
    for (int i = 0; i < 1; i++) {
      numbertab[i] = PyFloat_FromDouble(c_constants[i]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 1;
    int8_t const cint_constants_1[] = {0,1,2,3,4,5,6,7,8,9};
    int32_t const cint_constants_4[] = {137192776L,235806214L,238750788L,265810548L};
    for (int i = 0; i < 14; i++) {
      numbertab[i] = PyLong_FromLong((i < 10 ? cint_constants_1[i - 0] : cint_constants_4[i - 10]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<15; ++i) {
      #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
      }
      #else
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 3;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 4;
    unsigned int flags : 10;
    unsigned int first_line : 12;
} __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,
        PyObject *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 = {2, 0, 1, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE), 1375};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_call};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_flight_info, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1662};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_action_response, __pyx_mstate->__pyx_kp_b_iso88591__10, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1674};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_criteria, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_listing, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_criteria, __pyx_mstate->__pyx_n_u_stop_handler};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_list_flights, __pyx_mstate->__pyx_kp_b_iso88591_XQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 88};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_munge_grpc_python_error, __pyx_mstate->__pyx_kp_b_iso88591_q_1F_5_PQQR_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_D_7_D_1, 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), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591__11, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_4D_7RS_4D_1, 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), 16};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_4D_7RS_4D_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_5T_GST_5T_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_2_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_2_awk_PQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_4q_RYYZ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_8_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_8_AWKwVW_8, 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), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_5QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_7t1G_gUV_7t, 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), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_4AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 276};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_limit, __pyx_mstate->__pyx_n_u_actual};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Ry_IQ_Ja, 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), 314};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 323};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_action};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_V81A_j_a_q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 350};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_make_action, __pyx_mstate->__pyx_kp_b_iso88591_A_vQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 381};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_R_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_V81A_gV1_QnA_QgQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 439};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_auth};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_y_KvQnA_1_7_1_q, 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), 446};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_T_3EQ, 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), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 527};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_for_path, __pyx_mstate->__pyx_kp_b_iso88591_A_HAQ_k_k_T_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 536};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_command, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_for_command, __pyx_mstate->__pyx_kp_b_iso88591_A_HAQ_k_k_q_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), 585};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 594};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_descriptor};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_HAQ_a_q, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 625};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 634};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_ticket};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_V81A_l_q_q_q, 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), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 669};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_equals, __pyx_mstate->__pyx_kp_b_iso88591_A_uCq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 677};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_host, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_c_host, __pyx_mstate->__pyx_n_u_c_port, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_for_grpc_tcp, __pyx_mstate->__pyx_kp_b_iso88591_A_gQa_hhaq_1_aq_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_host, __pyx_mstate->__pyx_n_u_port, __pyx_mstate->__pyx_n_u_c_host, __pyx_mstate->__pyx_n_u_c_port, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_for_grpc_tls, __pyx_mstate->__pyx_kp_b_iso88591_A_gQa_hhaq_1_aq_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_path, __pyx_mstate->__pyx_n_u_c_path, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_for_grpc_unix, __pyx_mstate->__pyx_kp_b_iso88591_A_gQa_hhaq_q_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 819};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 828};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_endpoint};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_XQa_N_q_q_q, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 878};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_R_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 887};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_xq_gV1_QnA_QgQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 1022};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_t2_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1031};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_serialized, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_deserialize, __pyx_mstate->__pyx_kp_b_iso88591_A_z_HD_q_1G1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_table};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read_all, __pyx_mstate->__pyx_kp_b_iso88591_A_q_G4r_6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_chunk};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read_chunk, __pyx_mstate->__pyx_kp_b_iso88591_A_7q_q_G4r_b_aq_Q_5_fCuD_V_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reader};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_to_reader, __pyx_mstate->__pyx_kp_b_iso88591_A_1_N_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 1178};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_cancel, __pyx_mstate->__pyx_kp_b_iso88591_A_D_t3gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1183};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c_table, __pyx_mstate->__pyx_n_u_stop_token, __pyx_mstate->__pyx_n_u_stop_handler};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read_all, __pyx_mstate->__pyx_kp_b_iso88591_A_fA_l_a_1_D_t1_V1AQ, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_c_schema, __pyx_mstate->__pyx_n_u_c_options};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_kp_b_iso88591_A_Qha_q_HBfAZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_c_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write_metadata, __pyx_mstate->__pyx_kp_b_iso88591_A_ay_q_HBnAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1221};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_batch, __pyx_mstate->__pyx_n_u_custom_metadata};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write_batch, __pyx_mstate->__pyx_kp_b_iso88591_A_q_HB_q_e9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 1242};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_table, __pyx_mstate->__pyx_n_u_max_chunksize, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_c_max_chunksize, __pyx_mstate->__pyx_n_u_msg};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write_table, __pyx_mstate->__pyx_kp_b_iso88591_5Q_q_s_F_1_1_E_q_a_q_HBk_vQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_close, __pyx_mstate->__pyx_kp_b_iso88591_A_q_HBfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_batch, __pyx_mstate->__pyx_n_u_buf, __pyx_mstate->__pyx_n_u_c_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write_with_metadata, __pyx_mstate->__pyx_kp_b_iso88591_A_ay_q_HB_0_uIQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1298};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_done_writing, __pyx_mstate->__pyx_kp_b_iso88591_A_q_G4s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_mstate->__pyx_kp_b_iso88591_A_q_G4r_aq_4s_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1327};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_mstate->__pyx_kp_b_iso88591_A_1A_q_G4r_q_a, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_asyncio};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_Kw_r_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1347};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_as_awaitable, __pyx_mstate->__pyx_kp_b_iso88591_a_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1350};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result_or_exception, __pyx_mstate->__pyx_n_u_loop};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_wakeup, __pyx_mstate->__pyx_kp_b_iso88591_Q_t89A_Q_1_Q_H_A_Q_HM, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t9G1_q_4D_7RS_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1505};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_as_async, __pyx_mstate->__pyx_kp_b_iso88591_AT_B_8_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1509};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timeout, __pyx_mstate->__pyx_n_u_deadline};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_wait_for_available, __pyx_mstate->__pyx_kp_b_iso88591_4uCr_AT_a_4uCr_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1534};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_location, __pyx_mstate->__pyx_n_u_tls_root_certs, __pyx_mstate->__pyx_n_u_cert_chain, __pyx_mstate->__pyx_n_u_private_key, __pyx_mstate->__pyx_n_u_override_hostname, __pyx_mstate->__pyx_n_u_disable_server_verification};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_connect, __pyx_mstate->__pyx_kp_b_iso88591_A_q_4A_Qa_1_oQ_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1553};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_auth_handler, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_handler, __pyx_mstate->__pyx_n_u_c_options};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_authenticate, __pyx_mstate->__pyx_kp_b_iso88591_22Fa_WAQ_4z_1_LATQRRS_vR_1_q_G4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1576};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_username, __pyx_mstate->__pyx_n_u_password, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_user, __pyx_mstate->__pyx_n_u_pw};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_authenticate_basic_token, __pyx_mstate->__pyx_kp_b_iso88591_A_a_WAQ_G1A_T_B_QfA_DA_q_gQ_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1608};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_results, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_stop_handler, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_action_type, __pyx_mstate->__pyx_n_u_py_action};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_list_actions, __pyx_mstate->__pyx_kp_b_iso88591_8_WAQ_fA_Q_Q_1_t2_6_1_Q_q_Jay_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1629};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_action, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_results, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_action, __pyx_mstate->__pyx_n_u_do_action_response, __pyx_mstate->__pyx_n_u_do_action_response};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_action, __pyx_mstate->__pyx_kp_b_iso88591_Q_WAQ_QiuA_V1HA_q_V2Q_1HA_1A_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1702};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_descriptor};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_flight_info, __pyx_mstate->__pyx_kp_b_iso88591_5Q_1_WAQ_q_q_G4r_q_l_vQavQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1717};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_descriptor};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_schema, __pyx_mstate->__pyx_kp_b_iso88591_Q_0_haq_WAQ_q_G4q_av_fAQfA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1733};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ticket, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_get, __pyx_mstate->__pyx_kp_b_iso88591_B_WAQ_q_G4r_q_fJfAQa_1_gV1F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1752};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_schema, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_c_schema, __pyx_mstate->__pyx_n_u_c_do_put_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_descriptor, __pyx_mstate->__pyx_n_u_py_writer, __pyx_mstate->__pyx_n_u_py_reader};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_put, __pyx_mstate->__pyx_kp_b_iso88591_A_WAQ_q_q_G4r_q_a_q_a_a_gXQ_a_g, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1779};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_c_do_exchange_result, __pyx_mstate->__pyx_n_u_c_options, __pyx_mstate->__pyx_n_u_c_descriptor, __pyx_mstate->__pyx_n_u_py_writer, __pyx_mstate->__pyx_n_u_py_reader};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_exchange, __pyx_mstate->__pyx_kp_b_iso88591_a_1_WAQ_q_q_G4r_A_a_V1AQ_a_a_37, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1811};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_client};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_close, __pyx_mstate->__pyx_kp_b_iso88591_A_WD_7_Q_q_fA, 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), 1822};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1825};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc_type, __pyx_mstate->__pyx_n_u_exc_value, __pyx_mstate->__pyx_n_u_traceback};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_F, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_1_Qg_q_1_Qg, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_avQ, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 1930};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_peer_identity, __pyx_mstate->__pyx_kp_b_iso88591_A_wat8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1937};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_peer, __pyx_mstate->__pyx_kp_b_iso88591_A_y_XU_e1, 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), 1942};
    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_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_is_cancelled, __pyx_mstate->__pyx_kp_b_iso88591_A_t8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1946};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_add_header, __pyx_mstate->__pyx_kp_b_iso88591_A_HJawavWAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1950};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_value};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_add_trailer, __pyx_mstate->__pyx_kp_b_iso88591_A_HKq_q_gQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1954};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_c_middleware, __pyx_mstate->__pyx_n_u_middleware, __pyx_mstate->__pyx_n_u_c_trace_context, __pyx_mstate->__pyx_n_u_py_middleware, __pyx_mstate->__pyx_n_u_trace_context, __pyx_mstate->__pyx_n_u_pair};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_middleware, __pyx_mstate->__pyx_kp_b_iso88591_A_HN_1_1_4x_QgQa_1_1_c_A_0_7z_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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1994};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_q_G5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2025};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_c_message};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_q_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2055};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_q_G5_q, 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), 1};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2086};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_c_message};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_AQ_q_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2553};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_outgoing, __pyx_mstate->__pyx_n_u_incoming};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_authenticate, __pyx_mstate->__pyx_kp_b_iso88591_A_a, 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), 2567};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_token};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_is_valid, __pyx_mstate->__pyx_kp_b_iso88591_A_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_2_awk_PQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2592};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_outgoing, __pyx_mstate->__pyx_n_u_incoming};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_authenticate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_token, __pyx_mstate->__pyx_kp_b_iso88591_A_a_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_2_awk_PQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2636};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_start_call, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_8_AWKwVW_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_5QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2663};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_sending_headers, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2681};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_headers};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_received_headers, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2695};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exception};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_call_completed, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_1_Qg_q_1_Qg, 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), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2727};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_headers};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_start_call, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_8_AWKwVW_8, 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), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_5QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_t1G_V_t1G_V, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2780};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_sending_headers, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2798};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exception};
    __pyx_mstate_global->__pyx_codeobj_tab[164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_call_completed, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_a_vWE_Q_q_q_q_1_Qg_q_1_Qg, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2821};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_trace_context};
    __pyx_mstate_global->__pyx_codeobj_tab[167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[167])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2834};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_headers, __pyx_mstate->__pyx_n_u_instances, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_factory, __pyx_mstate->__pyx_n_u_instance, __pyx_mstate->__pyx_n_u_wrapper};
    __pyx_mstate_global->__pyx_codeobj_tab[168] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_start_call, __pyx_mstate->__pyx_kp_b_iso88591_A_A_E_D_wk_q_1_aq_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[168])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[169] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t_gQ_q_AWKW___A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[169])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[170] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[170])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2853};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_headers, __pyx_mstate->__pyx_n_u_instance, __pyx_mstate->__pyx_n_u_more_headers, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_values};
    __pyx_mstate_global->__pyx_codeobj_tab[171] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_sending_headers, __pyx_mstate->__pyx_kp_b_iso88591_A_L_Kwa_8_31_t1_Z_6_c_q_Qiwa_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[171])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2869};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exception, __pyx_mstate->__pyx_n_u_instance};
    __pyx_mstate_global->__pyx_codeobj_tab[172] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_call_completed, __pyx_mstate->__pyx_kp_b_iso88591_A_L_Kwa_O1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[172])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_dict_2, __pyx_mstate->__pyx_n_u_use_setstate};
    __pyx_mstate_global->__pyx_codeobj_tab[173] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_T_G1F_a_vWE_Q_q_t_wa_q_9_Qg_PWW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[173])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[174] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_6avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[174])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2885};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_server, __pyx_mstate->__pyx_n_u_status};
    __pyx_mstate_global->__pyx_codeobj_tab[175] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_finalize, __pyx_mstate->__pyx_kp_b_iso88591_A_T_A_7_Q_y_6_A_V5_q_vQ, 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};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, 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};
    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_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[177])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3044};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_criteria};
    __pyx_mstate_global->__pyx_codeobj_tab[178] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_list_flights, __pyx_mstate->__pyx_kp_b_iso88591_A_a_5, 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), 3064};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_descriptor};
    __pyx_mstate_global->__pyx_codeobj_tab[179] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_flight_info, __pyx_mstate->__pyx_kp_b_iso88591_A_a_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[179])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3084};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_descriptor};
    __pyx_mstate_global->__pyx_codeobj_tab[180] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_get_schema, __pyx_mstate->__pyx_kp_b_iso88591_A_a_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[180])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_writer};
    __pyx_mstate_global->__pyx_codeobj_tab[181] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_put, __pyx_mstate->__pyx_kp_b_iso88591_2_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[181])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3125};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_ticket};
    __pyx_mstate_global->__pyx_codeobj_tab[182] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_get, __pyx_mstate->__pyx_kp_b_iso88591_A_a_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[182])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3146};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_descriptor, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_writer};
    __pyx_mstate_global->__pyx_codeobj_tab[183] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_exchange, __pyx_mstate->__pyx_kp_b_iso88591_A_a_5, 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), 3166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[184] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_list_actions, __pyx_mstate->__pyx_kp_b_iso88591_A_a_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[184])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_action};
    __pyx_mstate_global->__pyx_codeobj_tab[185] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_do_action, __pyx_mstate->__pyx_kp_b_iso88591_A_a_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[185])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[186] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_serve, __pyx_mstate->__pyx_kp_b_iso88591_A_4wd_S_AQ_q_G4r1B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[186])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[187] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_run, __pyx_mstate->__pyx_kp_b_iso88591_A_Qa_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[187])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3227};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[188] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_shutdown, __pyx_mstate->__pyx_kp_b_iso88591_A_4wd_S_AQ_q_G4r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[188])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[189] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_wait, __pyx_mstate->__pyx_kp_b_iso88591_A_t2U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[189])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3251};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[190] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[190])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3254};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc_type, __pyx_mstate->__pyx_n_u_exc_value, __pyx_mstate->__pyx_n_u_traceback};
    __pyx_mstate_global->__pyx_codeobj_tab[191] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[191])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[192] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[192])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[193] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[193])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS), 3259};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_location, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[194] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pyarrow__flight_pyx, __pyx_mstate->__pyx_n_u_connect, __pyx_mstate->__pyx_kp_b_iso88591_H_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[194])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[195] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightError, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_haq_7_QnN_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[195])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[196] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightInternalErr, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_haq_7_5Q6LNZ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[196])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[197] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightTimedOutErr, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_haq_7_5Q6LNZ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[197])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[198] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightCancelledEr, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_xq_7_6a7Nn_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[198])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[199] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightServerError, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_HAQ_7_314H_VW_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[199])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[200] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightUnauthentic, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_XQa_7_A_ZZhhi_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[200])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[201] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightUnauthorize, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_9_TTbbc_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[201])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[202] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightUnavailable, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_7_8_9RR_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[202])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[203] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_AsyncioFlightClie, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_haq_7_5Q6LNZ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[203])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[204] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_FlightDataStream, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_81A_7_2_3FnTU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[204])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[205] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ServerAuthHandler, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_HAQ_7_314H_VW_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[205])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[206] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ClientAuthHandler, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_HAQ_7_314H_VW_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[206])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[207] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ClientMiddlewareF, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_9_TTbbc_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[207])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[208] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ClientMiddleware, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_81A_7_2_3FnTU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[208])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[209] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ServerMiddlewareF, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_9_TTbbc_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[209])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[210] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_TracingServerMidd, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_1_7_Abbppq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[210])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[211] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle_ServerMiddleware, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_81A_7_2_3FnTU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[211])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[212] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle__ServerMiddleware, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_2_1_7_A_Bddrrs_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[212])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pyx_type, __pyx_mstate->__pyx_n_u_pyx_checksum, __pyx_mstate->__pyx_n_u_pyx_state, __pyx_mstate->__pyx_n_u_pyx_result};
    __pyx_mstate_global->__pyx_codeobj_tab[213] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_tree_fragment, __pyx_mstate->__pyx_n_u_pyx_unpickle__ServerMiddleware_2, __pyx_mstate->__pyx_kp_b_iso88591_q_0_kQR_81A_7_VVdde_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[213])) 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)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Coroutine.init */
  if (likely(__pyx_Coroutine_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Coro_CheckExact.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedCoroType = PyObject_GetAttrString(typesModule, "CoroutineType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  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)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* Generator.init */
  if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
  
  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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by GetBuiltinName) */
#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;
}

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

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

/* PyDictVersioning (used by GetModuleGlobalName) */
#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);
}

/* PyObjectCall (used by PyObjectFastCall) */
#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 (used by PyObjectFastCall) */
#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 (used by PyObjectVectorCallKwBuilder) */
#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 (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #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
}

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

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

/* TupleAndListFromArray (used by fastcall) */
#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 (used by UnicodeEquals) */
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 (used by fastcall) */
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

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
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);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#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;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#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__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
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);
}

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

/* ParseKeywordsImpl (used by 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)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            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();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    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;
}

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

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

/* ArgTypeTestFunc (used by 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;
}

/* 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 {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

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

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

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_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;
}

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

/* tp_new */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __Pyx_tp_new_fallback(PyObject* type_obj, PyObject* args, PyObject* kwargs) {
    PyObject *new_func = NULL, *new_args = NULL, *obj;
    Py_ssize_t i, nargs = PyTuple_Size(args);
    if (unlikely(nargs < 0)) goto bad;
    new_args = PyTuple_New(nargs + 1);
    if (unlikely(!new_args)) goto bad;
    for (i = 0; i < nargs + 1; i++) {
        PyObject *item = (i == 0) ? type_obj : PyTuple_GetItem(args, i - 1);
        if (unlikely(!item)) goto bad;
        Py_INCREF(item);
        if (unlikely(PyTuple_SetItem(new_args, i, item)) < 0) goto bad;
    }
    new_func = PyObject_GetAttrString(type_obj, "__new__");
    if (unlikely(!new_func)) goto bad;
    obj = PyObject_Call(new_func, new_args, kwargs);
    Py_DECREF(new_func);
    Py_DECREF(new_args);
    return obj;
 bad:
    Py_XDECREF(new_func);
    Py_XDECREF(new_args);
    return NULL;
}
#endif
static PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs) {
    newfunc tp_new = __Pyx_PyType_TryGetSlot((PyTypeObject*)type_obj, tp_new, newfunc);
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    if (!tp_new) return __Pyx_tp_new_fallback(type_obj, args, kwargs);
#else
    assert(tp_new != NULL);
#endif
    return tp_new((PyTypeObject*)type_obj, args, kwargs);
}

/* ErrOccurredWithGIL */
static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) {
  int err;
  PyGILState_STATE _save = PyGILState_Ensure();
  err = !!PyErr_Occurred();
  PyGILState_Release(_save);
  return err;
}

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

/* GetTopmostException (used by SaveResetException) */
#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
}

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        if (unlikely(PyTuple_Check(key))) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args)) {
                PyErr_SetObject(PyExc_KeyError, args);
                Py_DECREF(args);
            }
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
    }
    return value;
}
#endif

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, 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, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#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

/* SetItemOnTypeDict (used by FixUpExtensionType) */
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))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                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);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                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;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
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 (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#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(PyTypeObject *metaclass, 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;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : 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);
    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;
}

/* CommonTypesMetaclass (used by CoroutineBase) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* SwapException (used by CoroutineBase) */
#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

/* CallTypeTraverse (used by CoroutineBase) */
#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

/* IterNextPlain (used by CoroutineBase) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
    if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
        __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
    return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    PyObject *result;
    PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
    if (unlikely(!next)) return NULL;
    result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
    return result;
#else
    (void)__Pyx_GetBuiltinName; // only for early limited API
    iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
    assert(iternext);
    return iternext(iterator);
#endif
}

/* PyObjectCall2Args (used by PyObjectCallMethod1) */
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);
}

/* PyObjectGetMethod (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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;
}
#endif

/* PyObjectCallMethod1 (used by CoroutineBase) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
#endif
}

/* PyObjectCallNoArg (used by CoroutineBase) */
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);
}

/* ReturnWithStopIteration (used by CoroutineBase) */
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
    if (value == Py_None) {
        if (async || !iternext)
            PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
        return;
    }
    __Pyx__ReturnWithStopIteration(value, async);
}
static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
#endif
    PyObject *exc;
    PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
#if CYTHON_COMPILING_IN_CPYTHON
    if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        if (PY_VERSION_HEX >= (0x030e00A1)) {
            exc = __Pyx_PyObject_CallOneArg(exc_type, value);
        } else {
            PyObject *args_tuple = PyTuple_New(1);
            if (unlikely(!args_tuple)) return;
            Py_INCREF(value);
            PyTuple_SET_ITEM(args_tuple, 0, value);
            exc = PyObject_Call(exc_type, args_tuple, NULL);
            Py_DECREF(args_tuple);
        }
        if (unlikely(!exc)) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(exc_type);
        __Pyx_ErrRestore(exc_type, exc, NULL);
        return;
    }
    #endif
#else
    exc = __Pyx_PyObject_CallOneArg(exc_type, value);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(exc_type, exc);
    Py_DECREF(exc);
}

/* CoroutineBase (used by Coroutine) */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#endif // CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void
__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
#if CYTHON_USE_AM_SEND
    gen->yieldfrom_am_send = NULL;
#endif
    Py_CLEAR(gen->yieldfrom);
}
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
            value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
            if (unlikely(!value)) goto limited_api_failure;
            #else
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            #endif
            Py_DECREF(ev);
        }
        else if (unlikely(PyTuple_Check(ev))) {
            Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(tuple_size < 0)) {
                Py_XDECREF(tb);
                Py_DECREF(ev);
                Py_DECREF(et);
                return -1;
            }
            #endif
            if (tuple_size >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#elif CYTHON_ASSUME_SAFE_MACROS
                value = PySequence_ITEM(ev, 0);
#else
                value = PySequence_GetItem(ev, 0);
                if (!value) goto limited_api_failure;
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
#else
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
#endif
    Py_DECREF(ev);
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!value)) return -1;
#endif
    *pvalue = value;
    return 0;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
  limited_api_failure:
    Py_XDECREF(et);
    Py_XDECREF(tb);
    Py_XDECREF(ev);
    return -1;
#endif
}
static CYTHON_INLINE
__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
    if (*retval) {
        return PYGEN_NEXT;
    } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
        return PYGEN_RETURN;
    } else {
        return PYGEN_ERROR;
    }
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(__Pyx_Coroutine_get_is_running(self));  // Callers should ensure is_running
    if (unlikely(self->resume_label == -1)) {
        __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
        return PYGEN_ERROR;
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    retval = self->body(self, tstate, value);
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    *result = retval;
    if (self->resume_label == -1) {
        return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
    }
    return PYGEN_NEXT;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
    ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
static PyObject *
__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (likely(result == PYGEN_RETURN)) {
        int is_async = 0;
        #ifdef __Pyx_AsyncGen_USED
        is_async = __Pyx_AsyncGen_CheckExact(gen);
        #endif
        __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
        Py_XDECREF(retval);
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE __Pyx_PySendResult
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
    __Pyx_PySendResult result;
    PyObject *val = NULL;
    assert(__Pyx_Coroutine_get_is_running(gen));
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
    Py_XDECREF(val);
    return result;
}
#if CYTHON_USE_AM_SEND
static __Pyx_PySendResult
__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
    PyObject *ret = NULL;
    __Pyx_PySendResult delegate_result, result;
    assert(__Pyx_Coroutine_get_is_running(gen));
    delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
    if (delegate_result == PYGEN_NEXT) {
        assert (ret != NULL);
        *retval = ret;
        return PYGEN_NEXT;
    }
    assert (delegate_result != PYGEN_ERROR || ret == NULL);
    __Pyx_Coroutine_Undelegate(gen);
    result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
    Py_XDECREF(ret);
    return result;
}
#endif
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
}
static __Pyx_PySendResult
__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    __Pyx_PySendResult result;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
      #if !CYTHON_USE_AM_SEND
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
      #endif
        {
            #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000
            if (value == Py_None && PyIter_Check(yf))
                ret = __Pyx_PyIter_Next_Plain(yf);
            else
            #endif
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
        }
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            *retval = ret;
            return PYGEN_NEXT;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return result;
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    CYTHON_UNUSED_VAR(gen);
    assert(__Pyx_Coroutine_get_is_running(gen));
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        result = __Pyx_Coroutine_Close(yf, &retval);
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
        result = PYGEN_RETURN;
    } else
    #endif
    {
        PyObject *meth;
        result = PYGEN_RETURN;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval)) {
                result = PYGEN_ERROR;
            }
        }
    }
    Py_XDECREF(retval);
    return result == PYGEN_ERROR ? -1 : 0;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __Pyx_PySendResult result;
    PyObject *retval = NULL;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    }
    #if CYTHON_USE_AM_SEND
    if (gen->yieldfrom_am_send) {
        result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
    } else
    #endif
    if (gen->yieldfrom) {
        PyObject *yf = gen->yieldfrom;
        PyObject *ret;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
            ret = __Pyx_PyIter_Next_Plain(yf);
        if (likely(ret)) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
    } else {
        result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
    }
    __Pyx_Coroutine_unset_is_running(gen);
    return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static __Pyx_PySendResult
__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PySendResult result;
    PyObject *yf;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
        *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
        return PYGEN_ERROR;
    }
    yf = gen->yieldfrom;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
    if (result == PYGEN_ERROR) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_Coroutine_unset_is_running(gen);
        if (!__Pyx_PyErr_Occurred()) {
            return PYGEN_RETURN;
        } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
            __Pyx_PyErr_Clear();
            return PYGEN_RETURN;
        }
        return PYGEN_ERROR;
    } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_RETURN;
    } else {
        const char *msg;
        Py_DECREF(*retval);
        *retval = NULL;
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
            msg = "async generator ignored GeneratorExit";
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        __Pyx_Coroutine_unset_is_running(gen);
        return PYGEN_ERROR;
    }
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf;
    if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    yf = gen->yieldfrom;
    if (yf) {
        __Pyx_PySendResult result;
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                goto propagate_exception;
            goto throw_here;
        }
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    __Pyx_Coroutine_unset_is_running(gen);
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        Py_DECREF(yf);
        if (ret) {
            __Pyx_Coroutine_unset_is_running(gen);
            return ret;
        }
        result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
propagate_exception:
    {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
        __Pyx_Coroutine_unset_is_running(gen);
        return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
    }
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    if (gen->gi_weakreflist != NULL)
    #endif
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        {
            destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor);
            if (del) del(self);
        }
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
#if CYTHON_USE_TP_FINALIZE
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *retval = NULL;
        __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
        if (result == PYGEN_ERROR) {
            PyErr_WriteUnraisable(self);
        } else {
            Py_XDECREF(retval);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
}
#endif
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
{
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject *frame;
    #if PY_VERSION_HEX >= 0x030d0000
    Py_BEGIN_CRITICAL_SECTION(self);
    #endif
    frame = self->gi_frame;
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        PyObject *globals = PyDict_New();
        if (unlikely(!globals)) return NULL;
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            globals,                        /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        Py_DECREF(globals);
        if (unlikely(!frame))
            return NULL;
        if (unlikely(self->gi_frame)) {
            Py_DECREF(frame);
            frame = self->gi_frame;
        } else {
            self->gi_frame = frame;
        }
    }
    Py_INCREF(frame);
    #if PY_VERSION_HEX >= 0x030d0000
    Py_END_CRITICAL_SECTION();
    #endif
    return frame;
#else
    CYTHON_UNUSED_VAR(self);
    Py_RETURN_NONE;
#endif
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
    CYTHON_UNUSED_VAR(context);
    PyObject *frame = self->gi_frame;
    if (frame)
        return __Pyx_NewRef(frame);
    return __Pyx__Coroutine_get_frame(self);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->yieldfrom_am_send = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    gen->gi_weakreflist = NULL;
#endif
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}
static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    gen->is_running = 1;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    assert(gen->is_running);
    gen->is_running = 0;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
}
static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
    char result;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_BEGIN_CRITICAL_SECTION(gen);
    #endif
    result = gen->is_running;
    #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_END_CRITICAL_SECTION();
    #endif
    return result;
}
static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
    CYTHON_UNUSED_VAR(closure);
    char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
    if (result) Py_RETURN_TRUE;
    else Py_RETURN_FALSE;
}
#if __PYX_HAS_PY_AM_SEND == 2
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
    Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
    if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
        return;
    }
    memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
    static_amsend_methods->am_send = am_send;
    type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
}
#endif
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    __Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
    PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
                         self_type_name);
    __Pyx_DECREF_TypeName(self_type_name);
    return NULL;
}

/* Coroutine (used by CoroutineYieldFrom) */
static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
    PyObject_GC_UnTrack(self);
    Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
    __Pyx_PyHeapTypeObject_GC_Del(self);
}
static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) {
    {
        int e = __Pyx_call_type_traverse((PyObject*)self, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(self->coroutine);
    return 0;
}
static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) {
    Py_CLEAR(self->coroutine);
    return 0;
}
static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) {
    return __Pyx_Generator_Next(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) {
    return __Pyx_Coroutine_Send(self->coroutine, value);
}
#if __PYX_HAS_PY_AM_SEND
static __Pyx_PySendResult __Pyx_CoroutineAwait_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
    return __Pyx_Coroutine_AmSend(((__pyx_CoroutineAwaitObject*)self)->coroutine, value, retval);
}
#endif
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) {
    return __Pyx_Coroutine_Throw(self->coroutine, args);
}
static __Pyx_PySendResult __Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result = __Pyx_Coroutine_Close(self->coroutine, &retval);
    Py_XDECREF(retval);
    return result;
}
static PyObject *__Pyx_CoroutineAwait_Close_Method(__pyx_CoroutineAwaitObject *self, PyObject *arg) {
    PyObject *retval = NULL;
    __Pyx_PySendResult result;
    CYTHON_UNUSED_VAR(arg);
    result = __Pyx_Coroutine_Close(self->coroutine, &retval);
    if (unlikely(result == PYGEN_ERROR))
        return NULL;
    Py_XDECREF(retval);
    Py_RETURN_NONE;
}
static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
    Py_INCREF(self);
    return self;
}
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_CoroutineAwait_no_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) {
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(args);
    CYTHON_UNUSED_VAR(kwargs);
    PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead");
    return NULL;
}
#endif
static PyMethodDef __pyx_CoroutineAwait_methods[] = {
    {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_CoroutineAwait_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyType_Slot __pyx_CoroutineAwaitType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CoroutineAwait_dealloc},
    {Py_tp_traverse, (void *)__Pyx_CoroutineAwait_traverse},
    {Py_tp_clear, (void *)__Pyx_CoroutineAwait_clear},
#if !CYTHON_COMPILING_IN_PYPY
    {Py_tp_new, (void *)__Pyx_CoroutineAwait_no_new},
#endif
    {Py_tp_methods, (void *)__pyx_CoroutineAwait_methods},
    {Py_tp_iter, (void *)__Pyx_CoroutineAwait_self},
    {Py_tp_iternext, (void *)__Pyx_CoroutineAwait_Next},
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_CoroutineAwait_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_CoroutineAwaitType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_CoroutineAwaitType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2 // backport
static __Pyx_PyAsyncMethodsStruct __pyx_CoroutineAwait_as_async;
#endif
static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
    __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_mstate_global->__pyx_CoroutineAwaitType);
    if (unlikely(!await)) return NULL;
    Py_INCREF(coroutine);
    await->coroutine = coroutine;
    PyObject_GC_Track(await);
    return (PyObject*)await;
}
static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
    if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) {
        PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine");
        return NULL;
    }
    return __Pyx__Coroutine_await(coroutine);
}
static PyMethodDef __pyx_Coroutine_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Coroutine_memberlist[] = {
    {"cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     PyDoc_STR("object being awaited, or None")},
    {"cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Coroutine_getsets[] = {
    {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     PyDoc_STR("name of the coroutine"), 0},
    {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     PyDoc_STR("qualified name of the coroutine"), 0},
    {"cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     PyDoc_STR("Frame of the coroutine"), 0},
    {"cr_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CoroutineType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_am_await, (void *)&__Pyx_Coroutine_await},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_methods, (void *)__pyx_Coroutine_methods},
    {Py_tp_members, (void *)__pyx_Coroutine_memberlist},
    {Py_tp_getset, (void *)__pyx_Coroutine_getsets},
    {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
#endif
    {0, 0},
};
static PyType_Spec __pyx_CoroutineType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_WEAKREF |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
    __pyx_CoroutineType_slots
};
#if __PYX_HAS_PY_AM_SEND == 2
static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async;
#endif
static int __pyx_Coroutine_init(PyObject *module) {
    __pyx_mstatetype *mstate;
    CYTHON_MAYBE_UNUSED_VAR(module);
    mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CoroutineType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CoroutineType_spec, NULL);
    if (unlikely(!mstate->__pyx_CoroutineType))
        return -1;
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineType, &__pyx_Coroutine_as_async, &__Pyx_Coroutine_AmSend);
#endif
#ifdef __Pyx_IterableCoroutine_USED
    if (unlikely(__pyx_IterableCoroutine_init(module) == -1))
        return -1;
#endif
    mstate->__pyx_CoroutineAwaitType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CoroutineAwaitType_spec, NULL);
    if (unlikely(!mstate->__pyx_CoroutineAwaitType))
        return -1;
#if __PYX_HAS_PY_AM_SEND == 2
    __Pyx_SetBackportTypeAmSend(mstate->__pyx_CoroutineAwaitType, &__pyx_CoroutineAwait_as_async, &__Pyx_CoroutineAwait_AmSend);
#endif
    return 0;
}

/* CoroutineSetYieldFrom (used by CoroutineYieldFrom) */
static void
__Pyx_Coroutine_Set_Owned_Yield_From(__pyx_CoroutineObject *gen, PyObject *yf) {
    assert (!gen->yieldfrom);
#if CYTHON_USE_AM_SEND
    assert (!gen->yieldfrom_am_send);
    #if PY_VERSION_HEX < 0x030A00F0
    if (__Pyx_PyType_HasFeature(Py_TYPE(yf), __Pyx_TPFLAGS_HAVE_AM_SEND))
    #endif
    {
        __Pyx_pyiter_sendfunc am_send;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
        am_send = __Pyx_PyObject_TryGetSubSlot(yf, tp_as_async, am_send, __Pyx_pyiter_sendfunc);
        #else
        __Pyx_PyAsyncMethodsStruct* tp_as_async = (__Pyx_PyAsyncMethodsStruct*) Py_TYPE(yf)->tp_as_async;
        am_send = tp_as_async ? tp_as_async->am_send : NULL;
        #endif
        if (likely(am_send)) {
            gen->yieldfrom_am_send = am_send;
        }
    }
#endif
    gen->yieldfrom = yf;
}

/* Coro_CheckExact (used by GetAwaitIter) */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyCoro_CheckExact(PyObject *o) {
    return (PyObject*)Py_TYPE(o) == __pyx_mstate_global->__Pyx_CachedCoroType;
}
#endif

/* GetAwaitIter (used by CoroutineYieldFrom) */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(o)) {
        return __Pyx_NewRef(o);
    }
#endif
    return __Pyx__Coroutine_GetAwaitableIter(o);
}
static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
#if (PY_VERSION_HEX < 0x030d0000 || defined(_PyErr_FormatFromCause)) && !CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(source));
    _PyErr_FormatFromCause(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
#else
    PyObject *exc, *val, *val2, *tb;
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(source));
    assert(PyErr_Occurred());
    PyErr_Fetch(&exc, &val, &tb);
    PyErr_NormalizeException(&exc, &val, &tb);
    if (tb != NULL) {
        PyException_SetTraceback(val, tb);
        Py_DECREF(tb);
    }
    Py_DECREF(exc);
    assert(!PyErr_Occurred());
    PyErr_Format(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
    PyErr_Fetch(&exc, &val2, &tb);
    PyErr_NormalizeException(&exc, &val2, &tb);
    Py_INCREF(val);
    PyException_SetCause(val2, val);
    PyException_SetContext(val2, val);
    PyErr_Restore(exc, val2, tb);
#endif
}
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
    PyObject *res;
    unaryfunc am_await;
    am_await = __Pyx_PyObject_TryGetSubSlot(obj, tp_as_async, am_await, unaryfunc);
    if (likely(am_await)) {
        res = (*am_await)(obj);
    } else
#if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
#if PY_VERSION_HEX >= 0x030C00A6
    if (PyGen_CheckExact(obj) && (PyGen_GetCode((PyGenObject*)obj)->co_flags & CO_ITERABLE_COROUTINE)) {
#else
    if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
#endif
        return __Pyx_NewRef(obj);
    } else
#endif
    {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
        PyObject *args[] = { obj };
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_await, args, 1 |  PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
        if (unlikely(!res)) {
            if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyObject *type, *value, *traceback;
                PyErr_Fetch(&type, &value, &traceback);
                int has_attr = PyObject_HasAttr(obj, __pyx_mstate_global->__pyx_n_u_await);
                PyErr_Restore(type, value, traceback);
                if (!has_attr) goto slot_error;
            }
        }
#else
        PyObject *method = NULL;
        int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_mstate_global->__pyx_n_u_await, &method);
        if (likely(is_method)) {
            res = __Pyx_PyObject_CallOneArg(method, obj);
        } else if (likely(method)) {
            res = __Pyx_PyObject_CallNoArg(method);
        } else
            goto slot_error;
        Py_DECREF(method);
#endif
    }
    if (unlikely(!res)) {
        __Pyx_Coroutine_AwaitableIterError(obj);
        goto bad;
    }
    if (unlikely(!PyIter_Check(res))) {
        __Pyx_TypeName res_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(res));
        PyErr_Format(PyExc_TypeError,
            "__await__() returned non-iterator of type '" __Pyx_FMT_TYPENAME "'", res_type_name);
        __Pyx_DECREF_TypeName(res_type_name);
        Py_CLEAR(res);
    } else {
        int is_coroutine = 0;
        #ifdef __Pyx_Coroutine_USED
        is_coroutine |= __Pyx_Coroutine_Check(res);
        #endif
        is_coroutine |= __Pyx_PyCoro_CheckExact(res);
        if (unlikely(is_coroutine)) {
            /* __await__ must return an *iterator*, not
               a coroutine or another awaitable (see PEP 492) */
            PyErr_SetString(PyExc_TypeError,
                            "__await__() returned a coroutine");
            Py_CLEAR(res);
        }
    }
    return res;
slot_error:
    {
        __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
        PyErr_Format(PyExc_TypeError,
            "object " __Pyx_FMT_TYPENAME " can't be used in 'await' expression", obj_type_name);
        __Pyx_DECREF_TypeName(obj_type_name);
    }
bad:
    return NULL;
}

/* CoroutineYieldFrom */
  static __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Coroutine(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      __Pyx_PySendResult result;
      if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
          PyErr_SetString(
              PyExc_RuntimeError,
              "coroutine is being awaited already");
          return PYGEN_ERROR;
      }
      result = __Pyx_Coroutine_AmSend(source, Py_None, retval);
      if (result == PYGEN_NEXT) {
          Py_INCREF(source);
          __Pyx_Coroutine_Set_Owned_Yield_From(gen, source);
      }
      return result;
  }
  static __Pyx_PySendResult __Pyx_Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      __Pyx_PySendResult result;
      PyObject *source_gen = NULL;
      source_gen = __Pyx_Coroutine_GetAwaitableIter(source);
      if (unlikely(!source_gen)) return PYGEN_ERROR;
      if (__Pyx_Coroutine_Check(source_gen)) {
          result = __Pyx_Coroutine_Yield_From_Coroutine(gen, source_gen, retval);
          Py_DECREF(source_gen);
          return result;
      }
      *retval = __Pyx_PyIter_Next_Plain(source_gen);
      if (*retval) {
          __Pyx_Coroutine_Set_Owned_Yield_From(gen, source_gen);
          return PYGEN_NEXT;
      }
      result = __Pyx_Coroutine_status_from_result(retval);
      Py_XDECREF(source_gen);
      return result;
  }
  static CYTHON_INLINE __Pyx_PySendResult __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source, PyObject **retval) {
      if (__Pyx_Coroutine_Check(source)) {
          return __Pyx_Coroutine_Yield_From_Coroutine(gen, source, retval);
      }
  #ifdef __Pyx_AsyncGen_USED
      if (__pyx_PyAsyncGenASend_CheckExact(source)) {
          *retval = __Pyx_async_gen_asend_iternext(source);
          if (*retval) {
              Py_INCREF(source);
              __Pyx_Coroutine_Set_Owned_Yield_From(gen, source);
              return PYGEN_NEXT;
          }
          return __Pyx_Coroutine_status_from_result(retval);
      }
  #endif
      return __Pyx_Coroutine_Yield_From_Generic(gen, source, retval);
  }
  
/* pep479 */
  static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
      PyObject *exc, *val, *tb, *cur_exc, *new_exc;
      __Pyx_PyThreadState_declare
      int is_async_stopiteration = 0;
      CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
      __Pyx_PyThreadState_assign
      cur_exc = __Pyx_PyErr_CurrentExceptionType();
      if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
          if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
              is_async_stopiteration = 1;
          } else {
              return;
          }
      }
      __Pyx_GetException(&exc, &val, &tb);
      Py_XDECREF(exc);
      Py_XDECREF(tb);
      new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
          is_async_stopiteration ? "async generator raised StopAsyncIteration" :
          in_async_gen ? "async generator raised StopIteration" :
          "generator raised StopIteration");
      if (!new_exc) {
          Py_XDECREF(val);
          return;
      }
      PyException_SetCause(new_exc, val); // steals ref to val
      PyErr_SetObject(PyExc_RuntimeError, new_exc);
  }
  
/* PyMethodNew (used by CythonFunctionShared) */
  #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 (used by CythonFunctionShared) */
  #if CYTHON_METH_FASTCALL && CYTHON_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;
      #if CYTHON_AVOID_BORROWED_REFS
      PyObject *pos;
      #else
      Py_ssize_t pos;
      #endif
      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 = 0;
      i = 0;
      keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
      while (__Pyx_PyDict_NextRef(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
          #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:
      #if CYTHON_AVOID_BORROWED_REFS
      Py_DECREF(pos);
      #endif
      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 (used by CythonFunction) */
  #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;
  }
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  static PyObject *
  __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
  {
      CYTHON_UNUSED_VAR(context);
      if (unlikely(op->func_dict == NULL)) {
          op->func_dict = PyDict_New();
          if (unlikely(op->func_dict == NULL))
              return NULL;
      }
      Py_INCREF(op->func_dict);
      return op->func_dict;
  }
  #endif
  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
  }
  #if CYTHON_COMPILING_IN_LIMITED_API
  static PyObject *
  __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
      CYTHON_UNUSED_VAR(context);
      return PyObject_GetAttrString(op->func, "__module__");
  }
  static int
  __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
      CYTHON_UNUSED_VAR(context);
      return PyObject_SetAttrString(op->func, "__module__", value);
  }
  #endif
  static PyGetSetDef __pyx_CyFunction_getsets[] = {
      {"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},
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
      {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
  #else
      {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
      {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
  #endif
      {"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},
  #if CYTHON_COMPILING_IN_LIMITED_API
      {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
  #endif
      {0, 0, 0, 0, 0}
  };
  static PyMemberDef __pyx_CyFunction_members[] = {
  #if !CYTHON_COMPILING_IN_LIMITED_API
      {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
  #endif
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
  #endif
  #if CYTHON_METH_FASTCALL
  #if 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
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      op->func_dict = NULL;
  #endif
      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
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      Py_CLEAR(m->func_dict);
  #elif PY_VERSION_HEX < 0x030d0000
      _PyObject_ClearManagedDict((PyObject*)m);
  #else
      PyObject_ClearManagedDict((PyObject*)m);
  #endif
      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
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      Py_VISIT(m->func_dict);
  #else
      {
          int e =
  #if PY_VERSION_HEX < 0x030d0000
              _PyObject_VisitManagedDict
  #else
              PyObject_VisitManagedDict
  #endif
                  ((PyObject*)m, visit, arg);
          if (e != 0) return e;
      }
  #endif
      __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
       __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
  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;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      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;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      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;
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      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);
      Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
      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;
      }
      #if PY_VERSION_HEX < 0x030e00A6
      size_t nargs_value = (size_t) nargs;
      #else
      Py_ssize_t nargs_value = nargs;
      #endif
      return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, 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_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 >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
      Py_TPFLAGS_MANAGED_DICT |
  #endif
      Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
      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(
          mstate->__pyx_CommonTypesMetaclassType, 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;
  }
  
/* WriteUnraisableException */
  static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                    int lineno, const char *filename,
                                    int full_traceback, int nogil) {
      PyObject *old_exc, *old_val, *old_tb;
      PyObject *ctx;
      __Pyx_PyThreadState_declare
      PyGILState_STATE state;
      if (nogil)
          state = PyGILState_Ensure();
      else state = (PyGILState_STATE)0;
      CYTHON_UNUSED_VAR(clineno);
      CYTHON_UNUSED_VAR(lineno);
      CYTHON_UNUSED_VAR(filename);
      CYTHON_MAYBE_UNUSED_VAR(nogil);
      __Pyx_PyThreadState_assign
      __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
      if (full_traceback) {
          Py_XINCREF(old_exc);
          Py_XINCREF(old_val);
          Py_XINCREF(old_tb);
          __Pyx_ErrRestore(old_exc, old_val, old_tb);
          PyErr_PrintEx(0);
      }
      ctx = PyUnicode_FromString(name);
      __Pyx_ErrRestore(old_exc, old_val, old_tb);
      if (!ctx) {
          PyErr_WriteUnraisable(Py_None);
      } else {
          PyErr_WriteUnraisable(ctx);
          Py_DECREF(ctx);
      }
      if (nogil)
          PyGILState_Release(state);
  }
  
/* CallUnboundCMethod1 */
  #if CYTHON_COMPILING_IN_CPYTHON
  static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
      int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
      if (likely(was_initialized == 2 && cfunc->func)) {
          int flag = cfunc->flag;
          if (flag == METH_O) {
              return __Pyx_CallCFunction(cfunc, self, arg);
          } else if (flag == METH_FASTCALL) {
              return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
          } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
              return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, 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__CallUnboundCMethod1(&tmp_cfunc, self, arg);
      }
  #endif
      PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
      __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
      return result;
  }
  #endif
  static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
      PyObject *result = NULL;
      if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
  #if CYTHON_COMPILING_IN_CPYTHON
      if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
          PyObject *args = PyTuple_New(1);
          if (unlikely(!args)) return NULL;
          Py_INCREF(arg);
          PyTuple_SET_ITEM(args, 0, arg);
          if (cfunc->flag & METH_KEYWORDS)
              result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
          else
              result = __Pyx_CallCFunction(cfunc, self, args);
          Py_DECREF(args);
      } else
  #endif
      {
          result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
      }
      return result;
  }
  
/* dict_getitem_default */
  static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
      PyObject* value;
  #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
      value = PyDict_GetItemWithError(d, key);
      if (unlikely(!value)) {
          if (unlikely(PyErr_Occurred()))
              return NULL;
          value = default_value;
      }
      Py_INCREF(value);
      if ((1));
  #else
      if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) {
          value = PyDict_GetItem(d, key);
          if (unlikely(!value)) {
              value = default_value;
          }
          Py_INCREF(value);
      }
  #endif
      else {
          if (default_value == Py_None)
              value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
          else
              value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
      }
      return value;
  }
  
/* IterNext */
  static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
      PyObject* exc_type;
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (unlikely(exc_type)) {
          if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
              return NULL;
          __Pyx_PyErr_Clear();
          Py_INCREF(defval);
          return defval;
      }
      if (defval) {
          Py_INCREF(defval);
          return defval;
      }
      __Pyx_PyErr_SetNone(PyExc_StopIteration);
      return NULL;
  }
  static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
      __Pyx_TypeName iterator_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(iterator));
      PyErr_Format(PyExc_TypeError,
          __Pyx_FMT_TYPENAME " object is not an iterator", iterator_type_name);
      __Pyx_DECREF_TypeName(iterator_type_name);
  }
  static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
      PyObject* next;
  #if !CYTHON_COMPILING_IN_LIMITED_API
      iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc);
      if (likely(iternext)) {
          next = iternext(iterator);
          if (likely(next))
              return next;
      #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
          if (unlikely(iternext == &_PyObject_NextNotImplemented))
              return NULL;
      #endif
      } else if (CYTHON_USE_TYPE_SLOTS) {
          __Pyx_PyIter_Next_ErrorNoIterator(iterator);
          return NULL;
      } else
  #endif
      if (unlikely(!PyIter_Check(iterator))) {
          __Pyx_PyIter_Next_ErrorNoIterator(iterator);
          return NULL;
      } else {
          next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator);
          if (likely(next))
              return next;
      }
      return __Pyx_PyIter_Next2Default(defval);
  }
  
/* 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,
                                                                int wraparound, int boundscheck, int unsafe_shared) {
      CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
  #if CYTHON_ASSUME_SAFE_SIZE
      Py_ssize_t wrapped_i = i;
      if (wraparound & unlikely(i < 0)) {
          wrapped_i += PyList_GET_SIZE(o);
      }
      if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
          return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
      } else
      if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
          return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
      }
      return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
  #else
      (void)wraparound;
      (void)boundscheck;
      return PySequence_GetItem(o, i);
  #endif
  }
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                                int wraparound, int boundscheck, int unsafe_shared) {
      CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
  #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      Py_ssize_t wrapped_i = i;
      if (wraparound & unlikely(i < 0)) {
          wrapped_i += PyTuple_GET_SIZE(o);
      }
      if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
          return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
      }
      return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
  #else
      (void)wraparound;
      (void)boundscheck;
      return PySequence_GetItem(o, i);
  #endif
  }
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                       int wraparound, int boundscheck, int unsafe_shared) {
      CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
  #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
      if (is_list || PyList_CheckExact(o)) {
          Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
          if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
              return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
          } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
              return __Pyx_NewRef(PyList_GET_ITEM(o, n));
          }
      } else
      #if !CYTHON_AVOID_BORROWED_REFS
      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)))) {
              return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
          }
      } else
      #endif
  #endif
  #if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
      {
          PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
          PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
          if (!is_list && 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 (is_list || 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
      (void)wraparound;
      (void)boundscheck;
      return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
  }
  
/* PyObjectCallMethod0 (used by dict_iter) */
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
  #if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
      PyObject *args[1] = {obj};
      (void) __Pyx_PyObject_CallOneArg;
      (void) __Pyx_PyObject_CallNoArg;
      return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
  #else
      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;
  #endif
  }
  
/* RaiseNoneIterError (used by UnpackTupleError) */
  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  }
  
/* UnpackTupleError (used by UnpackTuple2) */
  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 (used by dict_iter) */
  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_AVOID_BORROWED_REFS
  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_AVOID_BORROWED_REFS
      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;
          next_item = __Pyx_PyList_GetItemRef(iter_obj, pos);
          if (unlikely(!next_item)) return -1;
      } 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;
  }
  
/* decode_c_bytes (used by decode_cpp_string) */
  static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
           const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
           const char* encoding, const char* errors,
           PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
      if (unlikely((start < 0) | (stop < 0))) {
          if (start < 0) {
              start += length;
              if (start < 0)
                  start = 0;
          }
          if (stop < 0)
              stop += length;
      }
      if (stop > length)
          stop = length;
      if (unlikely(stop <= start))
          return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_unicode);
      length = stop - start;
      cstring += start;
      if (decode_func) {
          return decode_func(cstring, length, errors);
      } else {
          return PyUnicode_Decode(cstring, length, encoding, errors);
      }
  }
  
/* append */
  static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
      if (likely(PyList_CheckExact(L))) {
          if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
      } else {
          PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x);
          if (unlikely(!retval))
              return -1;
          Py_DECREF(retval);
      }
      return 0;
  }
  
/* ObjectGetItem */
  #if CYTHON_USE_TYPE_SLOTS
  static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
      PyObject *runerr = NULL;
      Py_ssize_t key_value;
      key_value = __Pyx_PyIndex_AsSsize_t(index);
      if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
          return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1);
      }
      if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
          __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index));
          PyErr_Clear();
          PyErr_Format(PyExc_IndexError,
              "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
          __Pyx_DECREF_TypeName(index_type_name);
      }
      return NULL;
  }
  static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
      __Pyx_TypeName obj_type_name;
      if (likely(PyType_Check(obj))) {
          PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
          if (!meth) {
              PyErr_Clear();
          } else {
              PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
              Py_DECREF(meth);
              return result;
          }
      }
      obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
      PyErr_Format(PyExc_TypeError,
          "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
      __Pyx_DECREF_TypeName(obj_type_name);
      return NULL;
  }
  static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
      PyTypeObject *tp = Py_TYPE(obj);
      PyMappingMethods *mm = tp->tp_as_mapping;
      PySequenceMethods *sm = tp->tp_as_sequence;
      if (likely(mm && mm->mp_subscript)) {
          return mm->mp_subscript(obj, key);
      }
      if (likely(sm && sm->sq_item)) {
          return __Pyx_PyObject_GetIndex(obj, key);
      }
      return __Pyx_PyObject_GetItem_Slow(obj, key);
  }
  #endif
  
/* CallNextTpDealloc */
  static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
      PyTypeObject* type = Py_TYPE(obj);
      destructor tp_dealloc = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type)
          tp_dealloc(obj);
  }
  
/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
      PyTypeObject* type = Py_TYPE(obj);
      traverseproc tp_traverse = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_traverse)
          return tp_traverse(obj, v, a);
      return 0;
  }
  
/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
      PyTypeObject* type = Py_TYPE(obj);
      inquiry tp_clear = NULL;
      while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
          type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
      if (type && tp_clear)
          tp_clear(obj);
  }
  
/* AllocateExtensionType */
  static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
      if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
          allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
          return alloc_func(t, 0);
      } else {
          newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
          if (!tp_new) {
              PyObject *new_str = PyUnicode_FromString("__new__");
              if (likely(new_str)) {
                  PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                  Py_DECREF(new_str);
                  return o;
              } else
                  return NULL;
          } else
      #endif
          return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
      }
  }
  
/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_2_4
  #define __PYX_HAVE_RT_ImportType_3_2_4
  static PyTypeObject *__Pyx_ImportType_3_2_4(PyObject *module, const char *module_name, const char *class_name,
      size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_4 check_size)
  {
      PyObject *result = 0;
      Py_ssize_t basicsize;
      Py_ssize_t itemsize;
  #if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
      PyObject *py_basicsize;
      PyObject *py_itemsize;
  #endif
      result = PyObject_GetAttrString(module, class_name);
      if (!result)
          goto bad;
      if (!PyType_Check(result)) {
          PyErr_Format(PyExc_TypeError,
              "%.200s.%.200s is not a type object",
              module_name, class_name);
          goto bad;
      }
  #if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
      basicsize = ((PyTypeObject *)result)->tp_basicsize;
      itemsize = ((PyTypeObject *)result)->tp_itemsize;
  #else
      if (size == 0) {
          return (PyTypeObject *)result;
      }
      py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
      if (!py_basicsize)
          goto bad;
      basicsize = PyLong_AsSsize_t(py_basicsize);
      Py_DECREF(py_basicsize);
      py_basicsize = 0;
      if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
          goto bad;
      py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
      if (!py_itemsize)
          goto bad;
      itemsize = PyLong_AsSsize_t(py_itemsize);
      Py_DECREF(py_itemsize);
      py_itemsize = 0;
      if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
          goto bad;
  #endif
      if (itemsize) {
          if (size % alignment) {
              alignment = size % alignment;
          }
          if (itemsize < (Py_ssize_t)alignment)
              itemsize = (Py_ssize_t)alignment;
      }
      if ((size_t)(basicsize + itemsize) < size) {
          PyErr_Format(PyExc_ValueError,
              "%.200s.%.200s size changed, may indicate binary incompatibility. "
              "Expected %zd from C header, got %zd from PyObject",
              module_name, class_name, size, basicsize+itemsize);
          goto bad;
      }
      if (check_size == __Pyx_ImportType_CheckSize_Error_3_2_4 &&
              ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
          PyErr_Format(PyExc_ValueError,
              "%.200s.%.200s size changed, may indicate binary incompatibility. "
              "Expected %zd from C header, got %zd-%zd from PyObject",
              module_name, class_name, size, basicsize, basicsize+itemsize);
          goto bad;
      }
      else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_2_4 && (size_t)basicsize > size) {
          if (PyErr_WarnFormat(NULL, 0,
                  "%.200s.%.200s size changed, may indicate binary incompatibility. "
                  "Expected %zd from C header, got %zd from PyObject",
                  module_name, class_name, size, basicsize) < 0) {
              goto bad;
          }
      }
      return (PyTypeObject *)result;
  bad:
      Py_XDECREF(result);
      return NULL;
  }
  #endif
  
/* ValidateBasesTuple (used by PyType_Ready) */
  #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 (used by MergeVTables) */
  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;
  }
  
/* DelItemOnTypeDict (used by SetupReduce) */
  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;
  }
  
/* 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;
  }
  
/* FormatTypeName (used by ValidateExternBase) */
  #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__9);
      }
      goto done;
  }
  #endif
  
/* ValidateExternBase */
  static int __Pyx_validate_extern_base(PyTypeObject *base) {
      Py_ssize_t itemsize;
  #if CYTHON_COMPILING_IN_LIMITED_API
      PyObject *py_itemsize;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
      itemsize = ((PyTypeObject *)base)->tp_itemsize;
  #else
      py_itemsize = PyObject_GetAttrString((PyObject*)base, "__itemsize__");
      if (!py_itemsize)
          return -1;
      itemsize = PyLong_AsSsize_t(py_itemsize);
      Py_DECREF(py_itemsize);
      py_itemsize = 0;
      if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
          return -1;
  #endif
      if (itemsize) {
          __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(base);
          PyErr_Format(PyExc_TypeError,
                  "inheritance from PyVarObject types like '" __Pyx_FMT_TYPENAME "' not currently supported", b_name);
          __Pyx_DECREF_TypeName(b_name);
          return -1;
      }
      return 0;
  }
  
/* PxdImportShared (used by FunctionImport) */
  #ifndef __PYX_HAVE_RT_ImportFromPxd_3_2_4
  #define __PYX_HAVE_RT_ImportFromPxd_3_2_4
  static int __Pyx_ImportFromPxd_3_2_4(PyObject *module, const char *name, void **p, const char *sig, const char *what) {
      PyObject *d = 0;
      PyObject *cobj = 0;
      d = PyObject_GetAttrString(module, "__pyx_capi__");
      if (!d)
          goto bad;
  #if (defined(Py_LIMITED_API) && Py_LIMITED_API >= 0x030d0000) || (!defined(Py_LIMITED_API) && PY_VERSION_HEX >= 0x030d0000)
      PyDict_GetItemStringRef(d, name, &cobj);
  #else
      cobj = PyDict_GetItemString(d, name);
      Py_XINCREF(cobj);
  #endif
      if (!cobj) {
          PyErr_Format(PyExc_ImportError,
              "%.200s does not export expected C %.8s %.200s",
                  PyModule_GetName(module), what, name);
          goto bad;
      }
      if (!PyCapsule_IsValid(cobj, sig)) {
          PyErr_Format(PyExc_TypeError,
              "C %.8s %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
               what, PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
          goto bad;
      }
      *p = PyCapsule_GetPointer(cobj, sig);
      if (!(*p))
          goto bad;
      Py_DECREF(d);
      Py_DECREF(cobj);
      return 0;
  bad:
      Py_XDECREF(d);
      Py_XDECREF(cobj);
      return -1;
  }
  #endif
  
/* FunctionImport */
  #ifndef __PYX_HAVE_RT_ImportFunction_3_2_4
  #define __PYX_HAVE_RT_ImportFunction_3_2_4
  static int __Pyx_ImportFunction_3_2_4(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
      union {
          void (*fp)(void);
          void *p;
      } tmp;
      int result = __Pyx_ImportFromPxd_3_2_4(module, funcname, &tmp.p, sig, "function");
      if (result == 0) {
          *f = tmp.fp;
      }
      return result;
  }
  #endif
  
/* 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__8);
          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;
  }
  
/* 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;
  }
  
/* 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;
  }
  
/* 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;
  }
  
/* CyFunctionClassCell */
  static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) {
      Py_ssize_t i, count = __Pyx_PyList_GET_SIZE(cyfunctions);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(count < 0)) return -1;
      #endif
      for (i = 0; i < count; i++) {
          __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *)
  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
              PyList_GET_ITEM(cyfunctions, i);
  #else
              __Pyx_PySequence_ITEM(cyfunctions, i);
          if (unlikely(!m))
              return -1;
  #endif
          __Pyx_CyFunction_SetClassObj(m, classobj);
  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
          Py_DECREF((PyObject*)m);
  #endif
      }
      return 0;
  }
  
/* 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 && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
          PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
          return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(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;
  }
  
/* CLineInTraceback (used by AddTraceback) */
  #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  #define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
  #elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  #define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
  #else
  PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
      PyObject **dict_ptr = _PyObject_GetDictPtr(o);
      return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
  }
  #endif
  static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
      PyObject *use_cline = NULL;
      PyObject *ptype, *pvalue, *ptraceback;
      PyObject *cython_runtime_dict;
      CYTHON_MAYBE_UNUSED_VAR(tstate);
      if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
          return c_line;
      }
      __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
      cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
      if (likely(cython_runtime_dict)) {
          __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
              use_cline, cython_runtime_dict,
              __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
      }
      if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
          c_line = 0;
      }
      Py_XDECREF(use_cline);
      Py_XDECREF(cython_runtime_dict);
      __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
      return c_line;
  }
  #endif
  
/* CodeObjectCache (used by AddTraceback) */
  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) {
          c_line = __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;
          if (c_line) {
              py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
          } else {
              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
  
/* CheckUnpickleChecksum */
  static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      PyObject *pickle_module = PyImport_ImportModule("pickle");
      if (unlikely(!pickle_module)) return;
      PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
      Py_DECREF(pickle_module);
      if (unlikely(!pickle_error)) return;
      if (checksum2 == checksum1) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
              checksum, checksum1, members);
      } else if (checksum3 == checksum2) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, members);
      } else {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, checksum3, members);
      }
      Py_DECREF(pickle_error);
  }
  static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      int found = 0;
      found |= checksum1 == checksum;
      found |= checksum2 == checksum;
      found |= checksum3 == checksum;
      if (likely(found))
          return 0;
      __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
      return -1;
  }
  
/* CIntFromPyVerify */
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
      __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
      __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
      {\
          func_type value = func_value;\
          if (sizeof(target_type) < sizeof(func_type)) {\
              if (unlikely(value != (func_type) (target_type) value)) {\
                  func_type zero = 0;\
                  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                      return (target_type) -1;\
                  if (is_unsigned && unlikely(value < zero))\
                      goto raise_neg_overflow;\
                  else\
                      goto raise_overflow;\
              }\
          }\
          return (target_type) value;\
      }
  
/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_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))
          } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          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;
  }
  
/* 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 !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);
          } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          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 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))
          } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          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;
  }
  
/* 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))
          } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          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_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 !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);
          } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          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
      }
  }
  
/* 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 !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);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          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
      }
  }
  
/* UpdateUnpickledDict */
  static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
      if (unlikely(!state_dict)) {
          return -1;
      }
      int non_empty = PyObject_IsTrue(state_dict);
      if (non_empty == 0) {
          Py_DECREF(state_dict);
          return 0;
      } else if (unlikely(non_empty == -1)) {
          return -1;
      }
      PyObject *dict;
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = PyObject_GetAttrString(obj, "__dict__");
      #else
      dict = PyObject_GenericGetDict(obj, NULL);
      #endif
      if (unlikely(!dict)) {
          Py_DECREF(state_dict);
          return -1;
      }
      int result;
      if (likely(PyDict_CheckExact(dict))) {
          result = PyDict_Update(dict, state_dict);
      } else {
          PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
          if (likely(obj_result)) {
              Py_DECREF(obj_result);
              result = 0;
          } else {
              result = -1;
          }
      }
      Py_DECREF(state_dict);
      Py_DECREF(dict);
      return result;
  }
  static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(state_size == -1)) return -1;
      #endif
      if (state_size <= index) {
          return 0;
      }
      return __Pyx__UpdateUnpickledDict(obj, state, index);
  }
  
/* 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 */
  #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  void __Pyx_init_runtime_version(void) {
      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;
      }
  }
  #endif
  static unsigned long __Pyx_get_runtime_version(void) {
  #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
      return Py_Version & ~0xFFUL;
  #else
      return __Pyx_cached_runtime_version;
  #endif
  }
  
/* Generator */
  static PyMethodDef __pyx_Generator_methods[] = {
      {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
       PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
      {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
       PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
      {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
       PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
      {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
      {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
      {0, 0, 0, 0}
  };
  static PyMemberDef __pyx_Generator_memberlist[] = {
      {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
       PyDoc_STR("object being iterated by 'yield from', or None")},
      {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
      {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
  #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
      {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
  #endif
      {0, 0, 0, 0, 0}
  };
  static PyGetSetDef __pyx_Generator_getsets[] = {
      {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
       PyDoc_STR("name of the generator"), 0},
      {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
       PyDoc_STR("qualified name of the generator"), 0},
      {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
       PyDoc_STR("Frame of the generator"), 0},
      {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
      {0, 0, 0, 0, 0}
  };
  static PyType_Slot __pyx_GeneratorType_slots[] = {
      {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
      {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
      {Py_tp_iter, (void *)PyObject_SelfIter},
      {Py_tp_iternext, (void *)__Pyx_Generator_Next},
      {Py_tp_methods, (void *)__pyx_Generator_methods},
      {Py_tp_members, (void *)__pyx_Generator_memberlist},
      {Py_tp_getset, (void *)__pyx_Generator_getsets},
      {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
  #if CYTHON_USE_TP_FINALIZE
      {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
  #endif
  #if __PYX_HAS_PY_AM_SEND == 1
      {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
  #endif
      {0, 0},
  };
  static PyType_Spec __pyx_GeneratorType_spec = {
      __PYX_TYPE_MODULE_PREFIX "generator",
      sizeof(__pyx_CoroutineObject),
      0,
  #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
      Py_TPFLAGS_MANAGED_WEAKREF |
  #endif
      Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
      Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
      __pyx_GeneratorType_slots
  };
  #if __PYX_HAS_PY_AM_SEND == 2
  static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
  #endif
  static int __pyx_Generator_init(PyObject *module) {
      __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
      mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
          mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
      if (unlikely(!mstate->__pyx_GeneratorType)) {
          return -1;
      }
  #if __PYX_HAS_PY_AM_SEND == 2
      __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
  #endif
      return 0;
  }
  static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
      __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
      PyObject *retval = NULL;
      if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
          return __Pyx_Coroutine_AlreadyRunningError(gen);
      }
      __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
      __Pyx_Coroutine_unset_is_running(gen);
      (void) result;
      assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
      assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
      return retval;
  }
  
/* 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);
      }
  }
  
/* 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);
      #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
      if (likely(result))
          result->_co_firsttraceable = 0;
      #endif
      return result;
    }
  #elif !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,
          PyObject *line_table,
          PyObject *tuple_dedup_map
  ) {
      PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_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) {
          Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(line_table_length == -1)) goto done;
          #endif
          Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
          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) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
      );
  done:
      Py_XDECREF(code_bytes);
      #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(varnames_tuple_dedup);
      #endif
      Py_DECREF(varnames_tuple);
      return code_obj;
  }
  
/* DecompressString */
  static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
      PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
      const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
      PyObject *methodname = PyUnicode_FromString("decompress");
      if (unlikely(!methodname)) return NULL;
      #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
      if (algo == 3) {
          PyObject *fromlist = Py_BuildValue("[O]", methodname);
          if (unlikely(!fromlist)) goto bad;
          module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
          Py_DECREF(fromlist);
      } else
      #endif
          module = PyImport_ImportModule(module_name);
      if (unlikely(!module)) goto import_failed;
      decompress = PyObject_GetAttr(module, methodname);
      if (unlikely(!decompress)) goto import_failed;
      {
          #ifdef __cplusplus
              char *memview_bytes = const_cast<char*>(s);
          #else
              #if defined(__clang__)
                #pragma clang diagnostic push
                #pragma clang diagnostic ignored "-Wcast-qual"
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic push
                #pragma GCC diagnostic ignored "-Wcast-qual"
              #endif
              char *memview_bytes = (char*) s;
              #if defined(__clang__)
                #pragma clang diagnostic pop
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic pop
              #endif
          #endif
          #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
          int memview_flags = 0x100;
          #else
          int memview_flags = PyBUF_READ;
          #endif
          compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
      }
      if (unlikely(!compressed_bytes)) {
          Py_DECREF(decompress);
          goto bad;
      }
      decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
      Py_DECREF(compressed_bytes);
      Py_DECREF(decompress);
      Py_DECREF(module);
      Py_DECREF(methodname);
      return decompressed;
  import_failed:
      PyErr_Format(PyExc_ImportError,
          "Failed to import '%.20s.decompress' - cannot initialise module strings. "
          "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
          module_name, algo);
  bad:
      Py_XDECREF(module);
      Py_DECREF(methodname);
      return NULL;
  }
  
#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 __Pyx_NewRef(b ? Py_True: 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 */
